Summary of UNIX commands

1994,1995,1996 Budi Rahardjo <rahardjo@iscom.com>

This is a summary of UNIX commands available on most UNIX systems. Depending on the configuration, some of the commands may be unavailable on your site. These commands may be a commercial program, freeware or public domain program that must be installed separately, or probably just not in your search path. Check your local documentation or manual pages for more details (e.g. man programname). This reference card, obviously, cannot describe all UNIX commands in details, but instead I picked commands that are useful and interesting from a user¼s point of view. Most of the commands described in this reference card are explained in my UNIX and Internet book which is written in „Bahasa Indonesia¾ )Indonesian language.) Rahardjo, Budi (1994), Buku Pegangan Sistem Unix dan Internet, Bellingham, WA: OpenPathways, xiv+251pp. Comb-bound, ISBN 1-885130-11-2. This book is available only by mail order. Send inquiry to Marina Schneider: mschneid@prairienet.org

 

Disclaimer

The author and publisher make no warranty of any kind, expressed or implied, including the warranties of merchantability or fitness for a particular purpose, with regard to the use of commands contained in this reference card. This reference card is provided „as is¾. The author and publisher shall not be liable for damage in connection with, or arising out of the furnishing, performance, or the use of these commands or the associated descriptions.

 

Conventions

bold
represents program name
dirname represents directory name as an argument filename represents file name as an argument [dirname] optional directory name (or other optional argument) as argument. If it is no given, current directory will be used.

 

Table of Contents

  1. Directory and file commands
  2. Print-related commands
  3. Miscellaneous commands
  4. Process management
  5. File archive and compression
  6. Text editors
  7. Mail programs
  8. Usnet news
  9. File transfer and remote access
  10. X window
  11. Graph, Plot, Image processing tools
  12. Information systems
  13. Networking programs
  14. Programming tools
  15. Text processors, typesetters, and previewers
  16. Wordprocessors
  17. Spreadsheets
  18. Databases

 

1. Directory and file commands

bdf
display disk space (HP-UX). See also df.
cat filename
display the content of file filename
cd [dirname]
change directory to dirname. If dirname is omitted, change to your home directory.
cp source destination
copy file source into file destination.
df [dirname]
display free disk space. If dirname is omitted, display all available disks. The output maybe in blocks or in Kbytes. Use df -k in Solaris 2.x
dtree
(visually) display directory structure
du [dirname]
display disk usage.
less filename
display filename one screenful. A pager similar to (better than) more.
ls [dirname]
list the content of directory dirname. Options: -a display hidden files -l display in long format
mkdir dirname
make directory dirname
more filename
view file filename one screenfull at a time
mv oldname newname
rename file oldname to file newname. If newname is a directory, then move oldname into directory newname.
pg filename
view filename one screenfull at a time (a pager).
pwd print working directory
rmdir dirname
remove directory dirname (if dirname is empty).
rm file1 [file2 ...]
remove files file1, file2, etc.
rm -r dirname
remove dirname recursively, removing all files and subdirectories underneath dirname.
xless
an X window pager (named after less)

 

2. Print-related commands

lp
print a file (HP-UX, Solaris 2.x)
lpq [-Pprintername]
query printer queue of the default printer. If printername is given, will query printer printername. (BSD, SunOS, Linux)
lpr [-Pprintername] filename
print filename (send filename to the default printer). If printername is given, will send to filename to printername. (BSD, SunOS, Linux)
lprm [-Pprintername] jobnum
remove printing job number jubnum from printer printername. (BSD, SunOS, Linux)
lpstat
check printer status (HP-UX, Solaris 2.x)

 

3. Miscellaneous commands

env
print or alter environment variables hostname display host name
man topic
display on-line manual on topic.
screen
create multiple screen with one physical screen. This program is useful if you have a text-only (e.g. vt100) terminal. Move around with control-A.
uname
print system name
users
display all users on-line
w
check who is doing what
which commandname
show the location of commandname
who
who is on-line on this machine

 

4. Process management

kill SIGNUM PID
Send signal SIGNUM to process ID PID, or kill (terminate) process with process ID number PID. For example:
kill -HUP 5555
nice programname
run program programname with lower priority (nicer to other users). Recommended for running background processes.
ps
check processes. The options for this command depends on the version and variation of your UNIX. Check your local documentation.
top
show (continuously) what process(es) is running.

 

5. File archive and compression

compress filename
make filename smaller (compression). filename will be replaced by filename.Z ( a .Z extension is added).
gunzip filename.gz
expand filename.gz into its original form (size) and remove the .gz extension. This is GNU unzip.
gzip filename
compress filename with GNU zip (gzip) and add .gz extension
mt
magnetic tape control program.
tar
combine files into one tar file, or extract files from a tar file. A tar file could be a device (magnetic tape as /dev/rst0) or a plain file. To extract filename.tar
tar xvf filename.tar To combine all files under dirname into filename.tar: tar cvf filename.tar dirname
uncompress filename.Z
expand filename.Z into its original size and remove the .Z extension
unarj filename.arj
exteract files from an ARJ archive
unzip filename.zip
extract files from filename.zip. The reverse of zip command.
zip zipname files
create an archive file (and compress it) called zipname.zip which contains files.
MTOOLS
There is a set of commands to access MS-DOS disks on systems equipped with floppy disk. Most DOS file commands are available (prefixed with „m¾):
mcopy, mdel, mdir, mmd, mtype, etc.

 

6. Text editors

asWedit
HTML editor
axe
a simple X window text editor
ee
easy edit: emacs with a help menu
elvis
a vi clone
emacs start emacs. A more extensive documentation is available on-line. Reference card for GNU emacs is also available from FSF GNU emacs distribution.
jed
jed text editor
joe [filename] a WordStar-like editor
nedit
a Motif-based text editor
pico
a simple text editor distributed as part of
pine
sqhm
SoftQuad¼s HoTMetaL HTML editor.
textedit [filename]
OpenWindow¼s text editor
vi [filename]
vi editor
vile [filename]
a vi-clone
vim [filename]
a vi-clone
xcoral
a multiwindow X window text editor that can be used to browse C functions and C++ classes.
xedit
a simple X window text editor
xemacs
X window Emacs (formerly Lucid Emacs)

 

7. Mail Programs

biff
notify new mail has arrived
elm
read and/or compose e-mail.
fastmail
quick batch mail (part of Elm)
from
list senders of mails in your mailbox
frm [foldername]
similar to
from, but has a better output. If foldername is present, it will list senders in folder foldername instead your incoming mailbox. This program is distributed as part of the elm package.
mail [userid]
read mail. If userid is given in the command line, it will be used in compose mode. After done, mail will be sent to userid
mailtool
OpenWindows mail program
mush
mail user shell. Similar to
mail, but has a better user interface.
newmail
notify new mail has arrived (part of
elm package)
pine
mail reader and composer.
xwafemail
X window interface of mail written in
wafe+perl.
There are also other e-mail packages, such as MH, which come with their own commands. For example, MH has the following commands (and more):
inc
incorporate mail into inbox folder.
scan
scan mailbox/folder
show
show current selected e-mail.
emacs, for example has its own mail reader M-x rmail and also M-x mh, within emacs window.

 

8. Usenet news

knews
interactive X window-based news reader
nn
read news with
nn (NoNews is good news.) Can be used to read through NNTP or spool.
nntidy
cleanup or tidy your .newsrc
rn
read news with
rn.
slrn
NNTP-based newsreader (can display color ANSI).
tin
newsreader
trn
threaded
rn newsreader
xrn
X window-based news reader
xvnews
Xview-based newsreader
xwafenews
X window-based newsreader written in wafe+perl

 

9. File transfer and remote access

bftp
batch FTP
ftp hostname
Using the
ftp prgram to perform FTP to/from host hostname.
ftptool
X-window (xview) based FTP prgram
kermit
send or receive files with kermit protovol.
kermit -s filename
to send filename
kermit -r filename
to receive filename
minicom
communication package similar to Procomm
ncftp hostname
a user-friendly FTP program
rlogin hostname [-l userid]
remote login to host hostname. If -l userid is given, will login as userid
rsh hostname
remote shell to host hostname
rz
receive (upload) files with zmodem
seyon
X window communication package
sz [-r] files
send (download) files with zmodem
telnet hostname [portnum]
connect to hostname with telnet. If portnum is specified, connect to port portnum. (Usually portnum is required if you want to connect to various services such as IRC or MUD.)
xc
xcomm communication package
xftp
X-window interface to FTP

 

10. X window

openwin
start OpenWindows
startx
start X window
Window manager
The following programs (window managers) are usually started when you type
openwin or startx. It is usually in your .xinitrc file.

fvwm
feeble window manager
mwm
Motif window manager
olvwm
OpenLook virtual window manager
olwm
OpenLook window manager
twm
tab window manager

X window programs
filemgr
OpenWindows file manager
oclock
display clock
xcalc
calculator
xclock
display clock
xfm
file managerX
xlock
lock your screen
xodo
odometer, track the distance your mouse travel
xterm
a terminal or shell session

 

11. Graph, Plot, and Image Processing Tools

coreldraw
start CorelDraw (commercial drawing program)
corelpaint
start Corel Paint program (a commercial painting program)
ghostview
a front-end of ghostscript (
gs).
giftrans
converts GIF image to transparant GIF.
gimp
image processing tool/drawing program with filters (plug-ins) to manipulate image.
gnuplot
a freeware plotting program capable of plotting 2D and 3D plots. It supports a wide variety of output formats.
gs
Ghostscript, a PostScript previewer. It can also be used to convert PostScript into other graphic formats.
pageview
preview PostScript file
ps2epsi file.ps [file.epsi]
create Adobe¼s Encapsulated PostScript Interchange (EPSI) format from a postscript file.
psselect infile [outfile]
select pages from a PostScript file.
pstoedit
converts PostScript to tgif format for editing
rplot
plot 2-D data
sxpm
show an XPM (X Pixmap) image.
tgif
an X window drawing tool. It can produce various output formats, including PostScript.
xfig
an X window drawing tool capable of producing fig output
xgraph a simple X window graphing program able to produce a bar graph.
xloadimage filename
image previewer
xpaint [filename]
X window painting program, undrestands various image format including GIF
xv [files]
image previewer and manipulation tools for X window. It supports various formats, including GIF, BMP, TIFF, and PostScript.

 

12. Information Systems

archie
search the Archie database for anonymous FTP sites
arena
X-window WWW-browser which understands HTML 3.0.
chimera
X-window WWW-browser
gopher
a Gopher client
hotjava
WWW browser that understands Java language
hypermail
converts mail into HTML
hytelnet access various libraries on the Internet
lynx
a text-based WWW-browser
Mosaic
NCSA X window WWW-browser
netscape
a WWW browser (X window) with a built in threaded newsreader
sgopher
a simple Gopher client, supports dumb terminal
swais
a text-based WAIS client
tkwww
Tk-based WWW browser
willow
a library, Z39.50 and WWW browser
xarchie
X-window interface of
archie
xgopher
X-window gopher client
xmosaic
X-window WWW-browser
xwais
X-window WAIS client

 

13. Networking programs

finger userid@hostname
check information of userid at host hostname
host domainname
find information about
domainname, such as its MX record or IP address
irc
Internet Relay Chat, a multi-user chat. Beware, addictive!
lpmudr
an LP MUD client. Beware, addictive!
nslookup
query information about a specific host through a domain name server. For example you can find IP address of a machine, MX record of a domain.
ping hostname
check if host
hostname is alive
rup [hostname]
show status of local machines. Of
hostname is given, only check that hostname talk useri@hostname
talk to
userid at host hostname
tf
Tiny Fugue, a MUD client
traceroute hostname
tracing IP packet from this host to
hostname
write userid
write to
userid screen/session
zlocate userid
use Zypher to locate
userid (where or which machine the user logs on)
zwrite userid
send a personal message to
userid through zypher.

 

14. Programming tools and shells

acc [files]
Sun¼s ANSI C compiler
bash
Born again shell. A
sh clone, but better
bison
a GNU implementation of
yacc
byacc
Berkeley yacc
cc
C compiler
CC
Sun¼s C++ compiler
cpp
C language preprocessor
csh
C-shell
dbx
a debugger program
dbxtool
X window interface to
dbx
f77
FORTRAN compiler
flex
GNU implementation of lex
g77
GNU Fortran compiler
g++
GNU C++ compiler
gawk
GNU
awk
gcc
GNU C compiler
gcl
GNU Common Lisp
gdb
GNU debugger
gofer
a Haskell implementation
grep
pattern file(s) search for a string, pattern, or regular expression in file(s)
imake
C preprocessor interface to the
make command. Usually it uses file Imakefile.
kcl
Kyoto Common Lisp
ksh
Korn shell
lex
lexical analyzer generator
lint
verify a C program
m4
macro language processor
make
maintain, update, compile, and regenerate related files by a set of rules defined in file
Makefile.
nm
print name list of object file
pc
pascal compiler
perl
Practical Extraction and Reporting Language, a powerful programming and scripting language
prolog
a Prolog system
rcs
resource / version control
sccs
source code control system
sed
stream editor
sh
Bourne shell
sml
New Jersey Standard ML
tclsh Tcl shell, a Tcl interpreter
tcsh
tcshell, a csh compatible shell but better
tgrind
reformat source code to make it pretty for printout
wish
a simple windowing shell, a tk/tcl implementation
xcl
ANSI C compiler for AIX
yacc
parsing program generator. Generate C code from a grammar
zsh
Z shell

 

15. Text processors, typesetters, and previewers

a2ps
converts ASCII to PostScript
grodvi
convert troff to TeX DVI
groff
GNU *roff
grops
convert troff to PostScript
gtroff
GNU troff
gxditview
display gtroff output files under X window.
ispell filename
interactive spelling program
latex filename.tex
process
filename.tex with LaTeX and generate filename.dvi (a DVI file)
lout
a layout or typesetting program
mp
format text, mail, news into a nice PostScript output.
nroff filename
process
filename with nroff
psnup
manipulate PostScript file to have n pages on one side
pstops
manipulate PostScript files to produce 2-up, 4-up, booklet, rotate and many other functions.
spell filename
spell the contents of filename
tex filename.tex
TeX document processing and typesetting.
troff filename
process filename with
troff
xdvi filename.dvi
preview DVI file (
filename.dvi)
xtex filename.dvi
preview filename.dvi

 

16. Wordprocessors

ez
Andrew Toolkit wordprocessor (free).
imaker
start an international version of FrameMaker
maker
start FrameMaker
tps
start Interleaf
wp
start Word Perfect

 

17. Spreadsheets

oleo
GNU spreadsheet
sc
spreadsheet calculator
xspread
X window version of
sc

 

18. Databases

isql connect to Sybase server jinx a curses, perl-based database sybperl access Sybase server with perl (script). dbflst, dbfget, dbfadd, dbfdel, dbfpack, dbfcreat, dbfscan DBF package to access DBF-format file (usually generated by xbase program), developed by Brad Eacker beaker@sgi.com

 

1994, 1995 Budi Rahardjo <rahardjo@isnet.org>