Unix Commands: A Quick Guide -v 1.4
© ECE Computer
Support 2002
This is a quick guide of UNIX commands available
on most UNIX systems. Depending on the configuration, some of the commands
may be unavailable on your system. All commands work on Sun Solaris operating
system version 2.5.1 (also known as SunOS 5.5.1) available on the the Sun
workstations in the EECS Department's Instructional Computing Laboratory
(ICL).
Table of Contents
Directory and File Commands
Print Commands
Process Control
Mail Programs
Text Editors
File Transfer
Compiler
Window Manager
X window programs
File Compression
Floppy Drive Commands
Miscellaneous Commands
Directory and File Commands
Command Description
cd d Change to directory called "d"
mkdir d Create new directory called "d"
mv f1 [f2...] d Move file "f" to directory called "d"
mv d1 d2 Rename directory d1 as d2
ls List files in directory
ls -1 filename List files in detail
-a filename Display of hidden files
cat filename List contents of file
more filename List file contents by screen
chmod mode filename Change permission(r/w/x) of file
cp f1 f2 Copy file f1 into f2
sort filename Alphabetically sort file called "f"
mv f1 f2 Rename file f1 as f2
rm f Delete (remove) file f
-r filename Delete (remove) file f recursively
dirname Delete (remove) directory recursively
rmdir dirname Delete (remove) directory(if given
directory is empty)
Return to Table of contents
Print Commands
Command Description
lpr -P printername f Output file to line printer
For ICL:
lpr -Picl2 filename
lpq -P printername display the queue of printer jobs
For ICL:
lpq -Picl2
lprm -P printername #job Removes the job from the printer queue
For ICL:
lprm -Picl2 -
Return to Table of Contents
Process Control
Command Description
CTRL/c * Interrupt processes
sleep n Sleep for n seconds
ps Print process status stats
kill -9 n Remove process n
CTRL/z * Suspend current process
exit Exit from shell
Return to Table of Contents
Mail Programs
Command Description pine Mail reader and composer elm Read and/or
compose e-mail from list the senders of mails newmail notify new mail has
arrived (part of elm package) frm List the senders of mails with subject mail
username@host Send mail to user For EECS: mail userid@eecs.uic.edu biff [y/n]
Instant notification of mail
Return to Table of Contents
Text Editors
Command Description pico filename A simple text editor vi filename
Vi editor emacs filename Emacs editor xemacs filename X window Emacs editor
nedit filename Nedit editor xedit filename A simple X window text editor
Return to Table of Contents
File Transfer
Command Description ftp hostname using ftp program to perform
FTP to/from hostname ncftp hostname A user-friendly FTP program (for a tutorial,
click here) xftp
X-window interface to FTP
Return to Table of Contents
Compilers
Command Description
cc filename C compiler
CC Filename Sun's C++ Compiler
gcc Filename GNU C Compiler
g++ Filename GNU C++ Compiler
f77 Filename Fortran77 Compiler
f90 Filename Fortran90 Compiler
pc Filename Pascal Compiler
Return to Table of Contents
Window Manager
Command Description
fvwm feeble window manager
mwm Motif window manager
olvwm OpenLook virtual window manager
olwm OpenLook window manager
twm Tom's window manager
(Credits: John Yancey(jyancey@acm.org)
Return to Table of Contents
X window programs
Command Description
filemgr OpenWindows file manager
xclock display clock
oclock display oclock
xcalc calculator
xlock lock your screen
xterm a terminal or shell session
Return to Table of Contents
File Compression
Command Description
compress filename Compressed filename
(filename will be replaced
by filename.Z(it will add .Z extension)
uncompress filename Expand filename.Z into its original
size and remove .Z extension
(Reverse of compress command)
gunzip filename.gz Expand filename.gz into its original size
and remove .gz extension
gzip filename Compress filename with GNU zip(gzip) and
add .gz extension
zip zipname files Create an archive compressed file called
which contains all files
unzip filename.zip Extract files from filename.zip.
(Reverse of zip command)
unarj filename.arj Extract files from filename.arj
tar Create tape archives and add or extract files
(use man tar for more information)
Return to Table of Contents
Floppy Drive Commands
Command Description
mdir List the contents of the floppy disk
mcopy file.unix a:file.floppy copies file from current directory to floopy
mcopy a:file.floppy file.unix copies file from floppy to current directory
mformat Formats the floppy disk into a MS-DOS like
disk
mdel a:filname Deletes a file called filename from the
floppy
eject Ejects the floppy from the drive
Return to Table of Contents
Miscellaneous Commands
Command Description
telnet hostname Connect to hostname using telnet program
who List logged in users
whoami Display current user
finger [username] Output user information
talk userid@hostname talk to userid at given hostname
write userid write to userid screen/session
ping hostname check if hostname is alive
man name Unix manual entry for name
pwd Print working directory
gs filename A postscript previewer
xv filename Image previewer
date Print date & time
history Display recent commands
alias [name] Display command aliases
quota -v Display disk quota for User
head f Output beginning of file f
tail f Output end of file f
passwd/yppasswd Change password
alias name1 name2 Create command alias
unalias name1[na2...] Remove command alias na
script filename Save terminal session to given filename
(Useful to store a.out)
logout/exit/quit/bye End terminal session
Return to Table of Contents
Disclaimer:
This reference guide is provided to get quick help on UNIX commands.
This reference guide does not describe all UNIX commands in details, but
describes commands that are useful from a user's point of view. All the
commands described here can be found in more explained details in the UNIX
books & on the Internet. The author is not liable for damage in connection
with, or arising out of the furnishing, performance, or the use of these
commands or the associated descriptions.
ECE Computer Support
Department of Electrical and Computer
Engineering
University of Illinois at Chicago
©Copyright Feb. 2002