Quick Unix Reference
Quick Unix Reference
http://sunsite.utk.edu/UNIX-help/quickref.html
1 Log In Session
1.1 Log In
Enter username at login: prompt. Be carefull - Unix is case sensitive. Enter password at password: prompt.
2 File System
2.1 Create a File
cat > file vi file Enter text and end with ctrl-D Edit file using the vi editor
Example: chmod go+rwx public.html adds read, write, and execute permissions for group and other on public.html.
1 of 4
4/3/2012 7:35 PM
http://sunsite.utk.edu/UNIX-help/quickref.html
2.12 Pathnames
simple: One filename or directory name for accessing local file or directory. Example: foo.c absolute: List of directory names from root directory to desired file or directory name, each separated by /. Example: /src/shared relative: List of directory names from working directory to desired file or directory name, each separated by /. Example: Mail/inbox/23
cd path/from/current/directory
3.0 Commands
3.1 Date
date display date and time
3.3 Printing
lpr file lpr -Pprinter file lpr -c# file lpr -d file lpq lprm -# print file on default printer print file on printer print # copies of file interpret file as a dvi file show print queue (-Pprinter also valid) remove print request # (listed with lpq)
3.4 Redirection
2 of 4
4/3/2012 7:35 PM
http://sunsite.utk.edu/UNIX-help/quickref.html
direct output of command to file instead of to standard output (screen), replacing current contents of file as above, except output is appended to the current contents of file command receives input from file instead of from standard input (keyboard) "pipe" output of cmd1 to input of cmd2 log everything displayed on the terminal to file; end with exit
4 Search Files
grep string filelist grep -v string filelist grep -i string filelist show lines containing string in any file in filelist show lines not containing string show lines containing string, ignore case
5 Information on Users
finger user or finger user@machine finger @machine who get information on a user list users on machine list current users
6 Timesavers
6.1 Aliases
alias string command abbreviate command to string
3 of 4
4/3/2012 7:35 PM
http://sunsite.utk.edu/UNIX-help/quickref.html
The file .mh_profile is used to enable/disable MH features. man mh-profile for more information.
4 of 4
4/3/2012 7:35 PM