Carnegie Mellon
Unix Boot Camp (fun fact the plural of Unix is Unices) (really)
Jenna MacCarley, Peter Pearson, Shashank Goyal 9/19/2015 (edited for PyLing by Reed Armstrong, 10/13/2015) Carnegie Mellon Connecting SSH Windows users: PuTTY (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) Mac/Linux users: Use ‘ssh’ command at terminal ssh [email protected]
Files Windows: WinSCP (simple) or Tectia (more complicated) Mac/Linux: FileZilla, or ‘scp’ command at terminal: scp –r [email protected]:~myfolder /some/local/folder scp myfile.c [email protected]:~myfolder Carnegie Mellon Editing with emacs
■ Open: emacs [
■ Make a directory for the corpus files to go in ■ mkdir
Running Python scripts: ■ (Python 2) python2 myscript.py [
■ Pressing tab will autocomplete file and folder names! ■ Control+c will stop execution of your current program! ■ To exit IDLE: exit() ■ Control+r will let you search your command history! ■ Control+l will clear your screen! ■ Use the up and down arrow keys to scroll through your command history! Carnegie Mellon Linux file pathing
■ ~ is your HOME DIRECTORY ■ This is where you start from after you SSH in ■ On bash, you can also use $HOME ■ . is an alias for your PRESENT WORKING DIRECTORY! ■ .. is the file path for the PARENT DIRECTORY of your present working directory! ■ / is the file path for the TOP-LEVEL DIRECTORY ■ You probably won’t use this too much on PSC Carnegie Mellon ls
■ Lists the files in the present working directory, or, if specified, dir. ■ pwd tells you your Present Working Directory. Carnegie Mellon cd
■ Changes your present working directory to directory ■ Your main tool for navigating a Unix file system Carnegie Mellon mkdir
■ Makes a directory dirname in your present working directory. ■ Directories and folders are the same thing! Carnegie Mellon mv
■ cp works similarly, but copies instead ■ for copying folders, use cp -r ■ dest can be into an existing folder (preserves name), or a file/folder of a different name ■ Also used to re-name files without moving them ■ src can be either a file or a folder Carnegie Mellon chmod
■ Change permissions of a file or directory ■ u (owner), g (group), o (others), a (all) ■ + (add permissions), - (remove) ■ r (read), w (write), x (eXecute) Carnegie Mellon rm
■ Essentially the delete utility ■ To remove an (empty) directory, use rmdir ■ To remove a folder and its contents, use rm -rf ▪ Please be careful. Don’t delete your project. ▪ There is no “Trash” here. It’s gone. Carnegie Mellon What’s in a file? (using less)
■ less
■ Compare files ■ file1 is < in the output; file2 is > ■ Could help for qualitative technique comparisons or version differencing Carnegie Mellon man
■ What is that command? What are its arguments? What does this library do? Check to see if it has a man page! ■ Pages viewed with less ■ Try it! ■ man grep ■ man sed ■ man cat ■ man man ■ etc. Carnegie Mellon