This summer I am sitting in on a computational linguistics course. It is the first instruction I have had about UNIX. Pretty Awesome.
This has required me to do some googling looking from terminal commands.
RegEx and Unicode:
One of the issues that I have had with RegEx has been what is a natural class? i.e. [A-Z], [A-Za-z], [0-9], etc. As a linguist I deal a lot with IPA characters, subscripts, superscripts, unicode, and diacritics. How am I to define a natural class with these? Can I define a natural class based on the phonology of the language?
I used an ssh connection from the Terminal today for the first time!
I feel like a real man now.
I needed to transfer a 106MB folder from one subdomain to another subdomain on my DreamHost webserver. It has been my experience that whenever I copy or move folders with a lot of sub-folders that something(s) do(es) not get copied all the time or all the way. So I needed to archive my files and move them as a single object. But I do not think it is possible to zip files with an FTP client (at least not with Interarchy). For a solution I turned to ssh and a lot of googling.
So to ssh into my webhost I had to enable a user from the DreamHost panel.
Press return/enter key again.
Wait for it to ask for the Password:
Enter the password of the FTP user who's username you inserted in place of the example USERNAME@ftp.yourdomain.com above.
If it asks you for the password multiple times, type in the same correct password each time.
Then you will be at the root in your Terminal window.
type: ssh firstname.lastname@example.org
You're logged in!
Now any time you want to log using SSH you can just repeat ssh email@example.com
from the command line (Terminal), no need to repeat the other steps.
So from here on I was in my webhost but still didn't know how to get around. Evidently I needed to use long paths so $ cd /home/username/directory would move me from directory to directory. I could not just $ cd /directory.
Once I was able to get to the directory I needed to archive, I still needed the archive commands.
I thought I wanted to use zip as my archive utility. The zip command to do that would be: $ zip -r folder.zip folder
Though my friend Daniel said that I might should have used tar gunzip tar.gz instead of using the zip command: "Zip compresses each file separately and then archives. Tar+gzip or tar+bzip2 archives first and then compresses."
The commands to use the tools Daniel suggested would be like the following:
tar+gzip $ tar -cf blah.tar folder/
$ gzip -9 blah.tar
gzip compressed tar I guess this is a combination of the above two commands. Not sure. Didn't try it. $ tar czvf folder.tgz folder
bzip2 $ tar jcvf filename.tbz folder
After the file was compressed I used Interarchy to move the single zip file to its new location. I also needed to unzip the file. (I also read this.)
To unzip the file I navigated to the directory where the file was located and then used this command: $ unzip folder.zip folder
I had to use the long path too. So it was really: $ unzip /home/username/directory/folder.zip folder