Linux: Using the Terminal
The table below provides a searchable list of commands that are mentioned in the Intro to Linux tutorial. For a printable list of commands, download the ACCRE Cheat Sheet.
|man||Displays the manual page for another command. For instance, "man ls" gives a manual on the ls command. You can even type "man man", which opens the manual for man itself.|
|pwd||Prints out the present working directory.|
|ls||Prints out the list of files in the current directory.|
|cd||Changes the directory.|
|mkdir||Makes a new, empty directory.|
|rmdir||Removes a directory. The directory must be empty first|
|rm -r||Removes a directory and any files that are contained within it.
Be very careful using it!
|cat||Displays the entire contents of a file from start to finish.|
|more||Displays the entire contents of a file page by page.|
|less||Displays the entire contents of a file page by page, with additional features such as using the arrow keys to scroll up and down. Counterintuitively, the less command has greater functionality than the more command! (http://www.greenwoodsoftware.com/less/faq.html#history)|
|cp -i, mv -i||Interactive mode: display a warning before copying or moving an existing file.|
|rm -i||Interactive mode: display a warning before every removal.|
|emacs||Edits text files; very popular with programmers.|
|vim (or vi)||Edits text files; very powerful but has a steep learning curve.|
|nano||Edits text files; easiest to learn.|
|chmod||Changes read/write/execute permissions for a file.|
|find||Finds files in a directory.
|alias||Automatically replaces one command with another:
alias login=”ssh firstname.lastname@example.org”
|env||Lists system variables.|
|export||Creates a system variable: export my_var=some_variable|
|echo||Prints text to the screen. To print a system variable, type $ then its name:
|.bashrc||A special file in your home directory that lets you define aliases and system
variables every time you start an ACCRE session.
|` (grave)||Any command within grave accents (not single quotes!) is executed first.
echo “Today’s date and time is `date`”
You can also use $(command) instead.
|2>&1||Error and output redirection to the same file.
|| (pipe)||Takes the output of the preceding command and makes it the input of the following command.
|grep||Gets a regular expression and prints it.
|sort||Sorts a file.|
|uniq||Filters duplicate lines.
|cut||Cuts specific fields or columns.
|sed||Stream editor; does search and replace.
|accre_storage||Check your quota usage.
|/home||Home directories, one for every user. /home is stored in GPFS, so it is shared among all nodes in the cluster. It is backed up nightly by tape.
|/data||Additional data storage available for purchase. /data is also stored in GPFS and backed up nightly by tape.
|/scratch||Scratch space. Also stored in GPFS, and disk/file quotas are more permissive. However, it is never backed up.
|/tmp||Recommended for temporary storage while your job is running. 30+ GB of space per core. Not stored in GPFS, and not backed up. Please move results to /home, /scratch, or /data and clean up /tmp when your job is done.