Common unix commands and utilities


Common unix commands and utilities



This page was created to list commonly used Unix commands and useful utilities that were available on a time-sharing Tru64 Unix system operated by the School of Earth Sciences in the early 2000s.
This page was edited in 2010 to remove special programs that were only available on the School's system, which is no longer in use. The remaining commands and utilities listed here should be available for all varieties of Unix and Linux, including Mac OS X (from the Terminal application).
Program listings are organized by general subject categories. Keys preceded by a ^ character are CONTROL key combinations. Access the online manual with the man program to get more information on these programs, for example, 
      man cp
To find a program not on this list (and there are hundreds), try the man program with the -k option followed by a keyword, for example, 
      man -k tape 
to find all on-line manual entries that refer to programs that work with tapes.

Terminal control characters for C-shell (csh)

^hbackspaceerase previously typed character
^uerase entire line of input so far typed
^dend-of-input for programs reading from terminal
^ssuspend writing to terminal (freezes terminal)
^qcontinue writing to terminal
^zsuspend currently running job; restart with bg or fg
^ckill currently running program and allow clean-up before exiting
^\emergency kill of currently running program with no chance of cleanup
Also see a list of special characters that should not be used in filenames.

Login and authentication

loginaccess computer; start interactive session
logoutdisconnect terminal session
passwdchange local login password; you must set a strong password that is not easily guessed
kinitobtain kerberos ticket for connections to other kerberized computers
kdestroydestroy kerberos tickets (authorizations)

Information

dateshow date and time
historylist of previously executed commands
manshow online documentation by program name
infoonline documentation for GNU programs
wwhowho is on the system and what they are doing
whoamiwho is logged onto this terminal
topshow system stats and top CPU using processes
uptimeshow one line summary of system status

File management

catcombine files
cpcopy files
lslist files in a directory and their attributes
mvchange file name or directory location
rmremove files
lncreate another link (name) to a file
chmodset file permissions
cryptencode/decode a file with a private key
gzipgunzipcompress/decompress a file
findfind files that match specific criteria

Display contents of files

catcopy files to display device
moreshow text file on display terminal with paging control
headshow first few lines of a file(s)
tailshow last few lines of a file; or reverse line order
vifull-featured screen editor for modifying text files
picosimple screen editor for modifying text files
grepdisplay lines that match a pattern
lprsend file to printer
prformat file with page headers, multiple columns, etc.
diffcompare two files and show differences
cmpcompare two binary files and report if different
commcompare two files; show common or unique lines
oddisplay binary files as eqivalent octal/hex codes
stringsshow printable text embedded in binary files
fileexamine file(s) and guess type: text, data, program, etc.
wccount characters, words, and lines in a file

Directories

cdchange to new directory
mkdircreate new directory
rmdirremove empty directory (you must remove files first)
mvchange name of directory
pwdshow current directory

Disks

dfsummarize free space on disk filesystems
dushow disk space used by files or directories

Special character handling for C-shell (See man csh)

*match any characters in a file name
~usershorthand for home directory of user
$namesubstitute value of variable name
\turn off special meaning of character that follows
'in pairs, quote string with special chars, except !
"in pairs, quote string with special chars, except !$
`in pairs, substitute output from enclosed command

Controlling program execution for C-shell (See man csh)

&run job in background
^ckill job in foreground
^zsuspend job in foreground
fgrestart suspended job in foreground
bgrun suspended job in background
;delimit commands on same line
()group commands on same line
!re-run earlier commands from history list
jobslist current jobs
psshow process information
killkill background job or previous process
nicerun program at lower priority
atrun program at a later time
crontabrun program at specified intervals
limitsee or set resource limits for programs
aliascreate alias name for program (normally used in .login file)
shcshexecute command file

Controlling program input/output for C-shell (See man csh)

|pipe output to input
>redirect output to a storage file
<redirect input from a storage file
>>append redirected output to a storage file
teecopy input to both file and next program in pipe
scriptmake file record of all terminal activity

Email and communication

msgsread system bulletin board messages
mailxsend/read email; can be run by other programs to send exisiting files via email
uuencode
uudecode
encode/decode a binary file for transmission via email
rnread USENET news groups

Editors and formatting utilities

sedprogrammable text editor for data streams
vifull-featured editor for character terminals
emacsGNU emacs editor for character terminals
xemacsGNU emacs editor for X Window terminals
picovery simple text editor
fmtfill and break lines to make all same length
foldbreak long lines to specified length

X Window client programs (output to X terminal or server)

xtermprovide login shell window
xauthmanipulate authorization files
xloadshow system load
xmanfull screen online manual viewer
xemacsGNU emacs editor
gvinterface to contol gs to display PostScript or PDF files on screen
xdvidisplay DVI files on X Window (screen preview)
gnuplotinteractive data plotting on screen

TeX typesetting system

texprocess TeX files to DVI (device independent) output
latexprocess LaTeX files to DVI
dvipsprint DVI files on Postscript laser printer
xdvidisplay DVI files on X Window (screen preview)
latex2htmltranslate LaTeX files to HTML (for web pages)

Printing (BSD based)

lprsend file to print queue
lpqexamine status of files in print queue
lprmremove a file from print queue
enscriptconvert text files to PostScript format for printing

Interpreted languages and data manipulation utilities

sedprogrammable text editor for data streams
awkpattern scanning and processing language
perlPractical Extraction and Report Language
sortsort or merge lines in a file(s) by specified fields
trtranslate characters
cutcut out columns from a file
pastepaste columns into a file
ddcopy data between devices; reblock; convert EBCDIC

Graphics and mapping

gnuplotinteractive data plotting; outputs to PostScript or X Window
gs"ghostscript" converter displays PostScript files on X Window displays or other devices

Networking/communications

sshremote login/command execution; encrypted
scpremote non-interactive file copy; encrypted
sftpremote interactive file copy; encrypted
telnetremote network login; plain text password - not recommended
ftpnetwork file transfer program; plain text password - not recommended
hostfind IP address for given host name, or vice versa
lynxweb browser for character based (text-only) terminals
gzipgunzipcompress/decompress a file
tarcombine multiple files/dirs into single archive
uuencode
uudecode
encode/decode a binary file for transmission via email

Compilers, interpreters and programming tools

cshcommand language interpreter (C-shell scripts)
kshcommand language interpreter (Korn-shell scripts)
shcommand language interpreter (Borne-shell scripts)
f77Fortran 77 compiler
f2cconvert fortran source code to C source code
gccGNU C compiler
g++GNU C++ compiler
dbxcommand-line symbolic debugger for compiled C or Fortran
makerecompile programs from modified source
cflowgenerate C flow graph

Programming libraries (see man library_name)

lapackFortran 77 routines for numerical linear algebra (supersedes LINPACK and EISPACK)
Xroutines to interface with X window system (no man page -- get the X Toolkit book)
dbmdatabase routines
xdrlibrary routines for external data representation
netcdfroutines for machine independent data representation

Tape manipulation and archiving

mtmanipulate tape drive and position tape
ddunformatted tape read and write; file conversion
tararchive disk files on tape or disk
ltfread/write ANSI standard label tapes

No comments:

Post a Comment