Skip to main content

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.

manDisplays 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.
pwdPrints out the present working directory.
lsPrints out the list of files in the current directory.
cdChanges the directory.
mkdirMakes a new, empty directory.
rmdirRemoves a directory. The directory must be empty first
rm -rRemoves a directory and any files that are contained within it.
Be very careful using it!
catDisplays the entire contents of a file from start to finish.
moreDisplays the entire contents of a file page by page.
lessDisplays 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! (
cpCopies files.
mvMoves files.
rmRemoves files.
cp -i, mv -iInteractive mode: display a warning before copying or moving an existing file.
rm -iInteractive mode: display a warning before every removal.
emacsEdits text files; very popular with programmers.
vim (or vi)Edits text files; very powerful but has a steep learning curve.
nanoEdits text files; easiest to learn.
chmodChanges read/write/execute permissions for a file.
findFinds files in a directory.
aliasAutomatically replaces one command with another:
alias login=”ssh”
envLists system variables.
exportCreates a system variable: export my_var=some_variable
echoPrints text to the screen. To print a system variable, type $ then its name:
echo $my_var
.bashrcA 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.
<Input redirection.
>Output redirection.
2>Error redirection.
2>&1Error and output redirection to the same file.
| (pipe)Takes the output of the preceding command and makes it the input of the following command.
wcWord count.
grepGets a regular expression and prints it.
sortSorts a file.
uniqFilters duplicate lines.
cutCuts specific fields or columns.
sedStream editor; does search and replace.
accre_storageCheck your quota usage.
/homeHome 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.

/dataAdditional data storage available for purchase. /data is also stored in GPFS and backed up nightly by tape.
/scratchScratch space. Also stored in GPFS, and disk/file quotas are more permissive. However, it is never backed up.
/tmpRecommended 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.