Alphabetized List of Main Unix Commands

This section contains an alphabetized list of common Unix commands which could be useful as a review and reference.   Note:  ^ x   means CTRL x   (hold down Control key and press x )

Some of the most useful UNIX COMMANDS
^ c
INTERRUPT program.
^ d
END text input (also logoff).
^ h
^ r
REPEAT last line typed (or !!).
^ q
Unlock terminal screen.
^ s
Stop the screen from scrolling.
^ u
UNDO last line typed.
^ w
Delete last WORD typed.
^ z
SUSPEND a running program.
Place stopped foreground job into BACKGROUND.
cat fileA >> fileB
APPEND fileA to end of fileB (add to end).
cat file
LIST file on screen (or where > or >> directs).
cc file.c
COMPILE C program in file.c.
cd dirname
CHANGE to dirname; default home, .. 1 up.
chmod code file
Change file's access restrictions.
cp oldfile newfile
COPY oldfile to newfile.
diff file1 file2
List lines DIFFERING in file1, file2.
f77 file.f
Fortran 77 compile.
fg [job #]
Place background job into FOREGROUND.
file fname
Determine fname's type.
grep pat fname
Look for pat in file fname.
head file
Print first 10 lines of file.
Return names and job # of suspended jobs.
kill -9 pid#
Cancel job with pid# (known from ps).
lp fname
Print fname on LINE PRINTER (System V).
Return status of jobs in print queue (BSD).
lpr file
Print file on LINE PRINTER (BSD).
lprm numb
Remove numb from print queue (BSD).
Return status of jobs in print queue (System V).
LIST files in present directory.
ls -l
Long listing of files (permissions owner group size date name).
ls dirname
List files in dirname, default .,
-l long, -s size, -CF coded, -a all (.files too).
man command
manual page for command.
mkdir dirname
Make directory dirname.
more file
List file, one screenful at a time.
mv oldfile newfile
MOVE (rename) oldfile to newfile, then remove oldfile.
ps -a
Return name and process ID's (pid#) of all current processes.
ps -fu user
List processes owned by user (System V).
Print working directory.
rm oldfile
REMOVE (erase) oldfile.
rm -rf directory
Remove directory and everything in it.
rmdir dirname
Remove directory dirname.
sort fname
SORT lines of fname based on options.
spell fname
Check fname for SPELLING.
tail file
Print file's last 10 lines on screen.
view file
Use the vi editor for VIEWING a file.
wc fname
COUNT number of lines | words | characters in fname.
who (w)
List current users.
Return my login name.

There are hundreds more ! See "UNIX Reference Desk", also try the command: xman
Moreover, using "alias" and Unix scripts, you can customize them and create your own.

Here are two neat ones... try them !

  • cal
  • look string (try: look surp )