Breadcrumb Links:

Simple Unix commands

Command   Description   Usage Example  Notes on Example 
man   view the online documentation   man cd   The manual pages for the cd command are displayed at your terminal.  
cat / more / less   list a file on standard output (default standard output is the terminal)   cat .bashrc   The contents of the .bashrc file are displayed. cat displays the whole file at once, whereas more and less display a screen at a time. 
head    list the beginning of a file on standard output   head -50 longfile   The first 50 lines of longfile are displayed.  
tail    list the end of a file on standard output   tail -70 longfile   The last 70 lines of longfile are displayed.  
cp    copy a file   cp oldfile newfile   A copy of oldfile is made, and saved as newfile.  
mv    move a file   mv oldfile newfile   oldfile is moved (renamed) to a file called newfile.  
rm    remove / delete a file   rm temp   Remove (delete) the file called temp.  
ls    list the contents of a directory   ls dir   If the directory name is omitted, current directory is assumed.  
chmod    change the access permissions of a file   chmod ugo+rwx file   Allow owner, group and others read, write and execute permission for file.  
pwd    print working directory   pwd   Gives the full pathname of the directory in which you are currently working.  
cd    change directory   cd subdir   Change to a subdirectory of your current directory or a directory specified in the CDPATH variable.  
mkdir    make / create a new directory   mkdir subdir   Creates a directory called subdir as a subdirectory of your current directory.  
rmdir    remove / delete a directory   rmdir subdir   Removes subdir, only if it is empty (contains no files).  
vi    invoke the vi editor   vi newfile   Edit the file newfile. If newfile does not exist, an empty file is opened for editing.  
diff    compare two files and show the differences   diff file1 file2   Compares file1 with file2.  
grep    search for a regular expression in a file   grep this file1   Prints out every line of the file file1 which contains the string this. Can also use wildcards in the search pattern.  
kill    terminate a process which is owned by you   kill 1234   Terminate the process with process id 1234. The -9 signal cannot be ``caught'' and therefore is a sure kill.