Basic UNIX Commands
Basic UNIX Commands
Note: Most but not all of the commands listed herein are part of UNIX, some
may not be available on every UNIX system. These commands are available
on rci and eden. Where the behavior is different between eden and rci it will
be noted.
NOTE: Items in italics indicate either a place holder where you would place
specific information or and item that may be omitted.
On-line Help
Basic Options:
-k locates commands by keyword
lookup
-s specifies a chapter or section to look
man -k keyword
in man -schap# cmd_name
-u basic usage description man -u
Basic Option:
-h basic usage description finger -h
Basic Option:
--help basic usage description cp --help
diff compares two files and reports the diff file1 file2
differences
Basic Option:
--help basic usage description diff --help
Basic Option:
-h basic usage description file -h
Basic Options:
-v show lines that do not contain the
string grep -v string file
-h basic usage description grep -h
Basic Option:
-h basic usage description gunzip -h
Basic Options:
-# show first # lines of the specified file head -20 filename
--help basic usage description head --help
Basic Option:
-Pprinter specifies the printer to be
checked lpq -Pprinter_name
Basic Options:
-Pprinter specifies the printer
-Nnote print note on burster page
-m send mail upon completion
Basic Options:
-a all files
-d list directories not their contents
Command Description Usage
Basic Option:
--help basic usage description mv --help
Basic Options:
-i interactive, ask before removal rm -i file
rm -r directory
-r recursive, descend into subdirectories
rm --help
removing files and then containing
directories.
--help basic usage description
Basic Option:
--help basic usage description rmdir --help
Basic Option:
-n sort numerically. sort -n filename
Basic Options:
-# show last # lines of the specified file tail -20 filename
--help basic usage description tail --help
Work Environment
Basic Option:
-h basic usage description whoami -h
Basic Option:
-h basic usage description jobs -h
Text Editors
pico the pico editor (less powerful than emacs) pico filename
teach-emacs the emacs on-line tutorial teach-emacs
Command Description Usage
Basic Option:
-flags basic usage description cc -flags
Basic Option:
-flags basic usage description CC -flags
Basic Option:
-flags basic usage description pc -flags
Command Description Usage
Web Browsers
Miscellaneous Information
Basic Option:
-h basic usage description units -h
Note 2:
In order to use the math libraries of linkable subroutines, the last item on the compile
command must be " -lm", as in "cc -o demo demo.c -lm"
Metacharacters
Metacharacter Description
In the default Rutgers UNIX shell (the T shell) with the default editor set to
emacs, commands may be edited and previous commands retrieved using
control characters:
<CTRL>d if not at end of the command line, delete the character at the cursor
if at end of command line, list possible command (or file) name
completions
<CTRL>t exchange the character to the left of the cursor with the character at the
cursor
<CTRL>w will erase from the cursor to the beginning of the line
<CTRL>y yank back the last item erased by <CTRL>k, <CTRL>u, or <CTRL>w
<ESC> c move the cursor to the right one "word", capitalizing while moving
<ESC> l move the cursor to the right one "word", making lower case while
moving
<ESC> u move the cursor to the right one "word", making upper case while
moving