UNIX Tutorial Summary

ls list files and directories
ls -a list all files and directories
mkdir make a directory
cd directory change to named directory
cd change to home-directory
cd ~ change to home-directory
cd .. change to parent directory
pwd display the path of the current directory
cp file1 file2 copy file1 and call it file2
mv file1 file2 move or rename file1 to file2
rm file remove a file
rmdir directory remove a directory
cat file display a file
more file display a file a page at a time
head file display the first few lines of a file
tail file display the last few lines of a file
grep 'keyword' file search a file for keywords
wc file count number of lines/words/characters in file
command > file redirect standard output to a file
command >> file append standard output to a file
command < file redirect standard input from a file
command1 | command2 pipe the output of command1 to the input of command2
cat file1 file2 > file0 concatenate file1 and file2 to file0
sort sort data
who list users currently logged in
a2ps -Pprinter textfile print text file to named printer
lpr -Pprinter psfile print postscript file to named printer
* match any number of characters
? match one character
man command read the online manual page for a command
whatis command brief description of a command
apropos keyword match commands with keyword in their man pages
command & run command in the background
emacs file open a window to edit the text of file
#/bin/tcsh first line of a script that initializes the type of shell to be tcsh
# text allows text to just be a comment and not be treated as a command
set variable=information set a shell variable to an integer or string of information
chmod +x file make the named file executable
chmod [options] file more generally, change access rights for named file
awk options program variables file awk command syntax for processing text files
pattern { action } format for an awk program text
/text/ awk program to find lines that match text
print text awk command to output text
NR awk variable that stores the line number
$number awk character to identify column number of a text file
; character to separate commands within an awk program
sin(angle) awk command to calculate sine of angle in radians
cos(angle) awk command to calculate cosine of angle in radians
atan2(y,x) awk command to calculate arctangent of y/x
command >! file send output of command to file and overwrite file if it exists
psxy filename(s) options > psfile make an postscript X-Y plot from filename
-J(plot-type)(X-axis-size)/(Y-axis-size) psxy option for plot size and shape
-R(Xstart)/(Xend)/(Ystart)/(Yend) psxy option for range of values
-B(X-axis-border)/(Y-axis-border)(which-borders) psxy option for axis borders
-S(symbol-type)(symbol-size) psxy option for symbol type
-M psxy option for plotting multiple line segments
pstext filename(s) options > psfile add text to a postscript plot from filename
-K GMT option for specifying more commands will add to the output file
-O GMT option for specifying output should be Overlayed on top of previous output

 

M.Stonebank@surrey.ac.uk, © 9th October 2000; Revised brudzimr@muohio.edu, 19th August 2006