You are on page 1of 22

Command Index

Directory Commands cd cp/scp du ls mkdir mv pwd rmdir File Commands cat cmp cp / scp cvs del - see rm diff file find ftp / sftp grep less more mv pg rm touch wc Misc. Commands awk cal card date history kill man nice passwd ping ps tee tex / latex uname whatis whereis / which who / who am i

Security/Access chmod crypt passwd pgp scp sftp ssh

Printing a2ps enscript lp lpq lpr lprm lpstat

Editors/Formatters emacs groff ne nedit nroff pico sed troff vi

Compilers c / c++ dbx

Shell-Related Cmds bash csh

Mail elm fetchmail

ddd f77 / f90 / g77 g++ / gcc gdb icon java lint perl

ksh printenv setenv sh ssh tcsh

mail mutt pine procmail sendmail

Compression bzip2 / bzcat compress / uncompress pack / unpack tar uudeview uuencode / uudecode zcat / gzip / gunzip zcmp / zdiff zip / unzip

Viewer acroread display gv(ghostview) head less more pg tail xv / xview

Special / Local ftp ezquota / quota finger / ph hottip info pbs pplinfo rlogin setup telnet unix2dos / dos2unix xdisk paths & operators

List of Commands, Paths, Shortcuts, Operators


These command descriptions are only intended to provide thumbnail sketches. Command options and examples are provided only for fairly common instances. Otherwise, you're asked to use the man or info utilities for documentation. For related information, please see the list of Installed Software

. Shortcut for current directory path

usage: . as source or destination path options: none example: cp ./temp.txt ../temp.txt copies temp.txt from the current directory. example: ls ./ --lists all files in the current directory

.. Shortcut for parent of current working directory path usage: .. as source or destination path options: none example: cp ../temp.txt ./temp.txt--copies temp.txt from the parent directory. example: ls ../ --lists all files in the parent directory example: cd .. --move one directory node up

- Symbolizes stdin usage: - when used as input path, specifies that input will come from stdin which is the keyboard options: none example: cat - > newfile--whatever you enter from keyboard will be used as input to create the new file newfile example: gunzip -c file.tgz | tar xf - --unzip file.tgz to stdout and send it to stdin of tar

~ (tilde): Shortcut for your home path usage: ~ options: none example: cd ~ --change from current directory back to your home

> Redirect stdout to a file usage: > to destination path (file) options: none example: man cat > manfiles--route manpage output for cat to a file called manfiles

>> Append redirected stdout to a file usage: >> append output to an existing file options: none example: man lpr >> manfiles--append manpage output for lpr to the existing file called manfiles

& Place a job in background usage: & run specified job in background options: none example: cc fix32 & --run the C compiler in background

| (pipe) Route output of command to the left of it to input of the command to the right of it usage: | followed by a second process options: none example: $who | wc -l--count the number of users on the system example: ls | more--list files in current directory and display them one page at a time ("pipe stdout to more)

a2ps: Prints All (Text, PS, PDF, PCL) file types; see Printing Webpage for more options and examples usage: a2ps [options] [files] options: -Pnohole (default queue) | -P3hole | -j borders | --portrait | --landscape | -2 two-up | -prologue=fontname | -ffontsize; see "info a2ps" also example: a2ps -2 chap1.pdf--prints PDF file 2-up on no-hole paper which is default print queue

acroread: Adobe Acrobat Reader for PostScript and PDF files; requires X-Windows usage: acroread [options][files] option: -help; there is no manpage example: acroread chap1.pdf--displays PDF using GUI viewer

awk: Pattern scanning and processing language usage: awk [options][file] options: -f progfile read scan patterns from the file progfile example: awk '{print $1 + $2}' file1--prints sum of first 2 fields of each line in file1

bash: Bourne Again SHell usage: bash [options][args] options: see "man bash" or "info bash" example: bash script

bzip2 / bzcat: GNU block-sorting compression/decompression utility usage: bzip2 / bzcat [options][files] options: -z compress | -d decompress | -s limit blocksize to reduce memory usage example: bash script

c / c++ : C and C++ compilers usage: cc [options] pgm-name options: -o filename overrides default file name of a.out | -c suppress link edit | -g symbol table for dbx or gdb | -O optimize object code | -w suppress warnings example: cc myprog.c--compiles C program, placing executable in a.out example: cc myout myprog.c--compiles C program, placing executable in myout instead of a.out

cal: Calendar usage: cal [[month] year]- displays the calendar for the current month options: none example: cal 1 2001--displays the January calendar for 2001

card: Prints a quick reference card for a program from its inline help usage: card [options] program options: -h displays help for card | -v display just version info | -- options for a2ps are to follow example: card perl -- -P3hole -4--prints reference card for perl on 3-hole paper, 4-up

cat: Concatenate or display files usage: cat [options][files] options: -n number all lines | -b number all non-blank lines | -v output non-printing characters example: cat -n temp.txt--outputs temp.txt and numbers all lines example: cat -b temp.txt--outputs temp.txt and numbers all used lines example: cat file1--displays file1 example: cat file1 file2 > file3--creates file3 containing file1, then file2

cd: Change Directory usage: cd [directory] options: none example: cd public_html--sets public_html as current working directory example: cd--change working directory to your home directory

chmod: Change access mode (permissions) of a file or directory usage: chmod [options][files] options: -f suppress error reporting | -R changes permission recursively--to all subdirectories example: chmod 777 -R public_html--changes permissions of everything in public_html to read write and execute for everyone example: chmod -777 temp--removes all permissions of file temp example: chmod a+x temp--gives All users of file temp execute access example: chmod go-r temp--removes read access for Group and Others users of file temp

cmp: Compares two files usage: cmp [options][file1][file2] options: -l print byte number and difference | -s silent except for return code example: cmp a.out old-prog.out--compares 2 executables example: cmp -s a.out old-prog.out--compares 2 executables but only output return codes example: cmp stat.txt proj-132.txt--compares 2 text files and display the differences

col: Filter out reverse-linefeeds from stdin usage: col [options] options: -b remove backspaces example: man awk | col -b | enscript -P3hole -U2--takes manpage for awk, removes backspace directives and prints the manpage with enscript 2-up on 3-hole paper

compress / uncompress: Compress file using Lempel-Ziv; uncompress file; output placed in file.Z usage: compress/uncompress [options][file1][file2] options: -c write to stdout instead of file | -f force compression/decompression example: compress book.pdf

cp: Copy a file, creating a new file usage: cp [file1] [file2] options: -r recursive, copy directory | -i interactive, prompts user to overwrite. example: cp temp1.txt temp2.txt--copies temp1.txt to new file temp2.txt example: cp -i temp2.txt temp1.txt--asks if you are sure you want to copy over temp1.txt See also scp about cross-machine copies.

crypt: Encodes (encrypts) or decodes a file usage: crypt [options][file] options: password example: crypt key < clear.file > encrypted.file example: crypt key < encrypted.file | lpr

csh: C Shell scripting language usage: csh[options][args] options: -i force interactive mode | -n parse commands without executing them | -v print input lines as read | -x print commands as executed example: csh -n clean-script--parse but don't run the script, looking for errors

cvs: File version-control system usage: cvs [options][files] options: see manpage

date: Displays date and time usage: date - displays the date according to the system clock; returns day, date, time options: -u display Greenwich Mean (universal) Time date

dbx: Debugger for C, C++ and Fortran usage: dbx [options][executable, core-file, or process-ID] options: see manpage

ddd: GNU GUI interface for dbx, gdb and other debuggers usage: ddd [options][executable, core-file, or process-ID] options: see manpage

del: del is an AIX-only command; rm is the SunOS equivalent

diff: Compares files or whole directories

usage: diff [options] [file1 or dir1] [file2 or dir2] options: -b ignore trailing blanks | -w ignore whitespace | -i ignore case of letters | -l long format, files summarized | -r recursively compare subdirectories example: diff -l ../printing ../archive--summarize differences between these two directories

display: ImageMagick software which displays a file (PDF, JPEG, etc.) using X-Windows usage: display [options][files] options: see manpage example: display party.jpg

du: Disk Usage summary by file or directory structure usage: du [options][files] options: -a make an entry for each file | -s display grand total only example: du -s--prints summary for current directory; also see ezquota

elm: Line-oriented mail system; reads mail on local machine only; cannot do IMAP usage: elm [options][address] options: see manpage

emacs: Editor usage: emacs [options][file] options: see "info emacs"

enscript: Converts text file to PostScript and prints; see Printing Webpage for more options and examples usage: enscript [options][files] options: -Pnohole (default queue) | -P3hole | -j borders | --portrait | --landscape | -U2 two-up | ffontname_fontsize; see manpage also example: man grep | enscript -j -U2--route manpage for grep to enscript for printing 4-up with a border

ezquota / quota: Quota displays storage quota and usage; locally-written ezquota displays email and storage quotas and usage amounts

usage: ezquota / quota options: -v (for quota)

f77 / f90 / g77: Fortran compiler; g77 is GNU version (see "info g77") usage: f77 options: -o filename overrides default file name of a.out | -c suppress link edit | -g symbol table for dbx | -O optimize object code | -w suppress warnings example: f77 -o fixed file.f--compile file.f and name executable "fixed"

fetchmail: Email retrieval utility; can do IMAP and POP; cannot read email (see mail or pine for that ability) usage: fetchmail [options][addresses] options: see manpage example: fetchmail--to invoke the Fetchmail email system

file: Tries to determine the type of file usage: file [file] option: -h don't follow symbolic link

find: Find files that match certain criteria usage: find [criteria] [options] [files] options: see "info find" example: find $HOME -name '#*'--find all files with names beginning with pound sign

ftp: File Transfer Protocol See sftp

finger / ph: These commands do not exist on this system. Same functionality can be obtained with pplinfo.

g++ / gcc: GNU version of C and C++ usage: g++ / gcc [options][files]

options: -o filename overrides default file name of a.out | -c suppress link edit | -g symbol table for gdb | -O optimize object code | -w suppress warnings See manpage or "info g++" or "info gcc"

gdb: GNU debugger for C, C++ and Fortran usage: dbx [options][executable, core-file, or process-ID] options: see manpage

grep: Search for a pattern in file or files usage: grep options: -b precede each line by the line number | -c count number of times found | -i ignore case of letters | -l print only names of files with line#s | -n print line# with line of text | -x match full lines example: grep -c alias .cshrc--counts the number of aliases in .cshrc example: grep -b alias .cshrc--shows where the aliases are in .cshrc example: grep -l main *--print names of files in current directory containing main

groff: Document-formatting tool usage: groff [options][files] options: see manpage

gv: Ghostview - PDF and PS previewer; requires X-Windows usage: gv [options][file] options: see manpage example: gs chap1.pdf

head: Display file to up to point specified usage: head [end line] [file] option: -n the first n lines will be displayed on stdout example: head -3 .cshrc--displays first 3 lines of .cshrc

history: Displays a chronologic list of the last n commands you've entered usage: history to display history usage: !! to recall last command (can be used for re-execution of command)

options: see manpage example: set history=100--to save a stack of 100 commands

hottip: Locally produced "mini-manpages" with information relevant to certain applications like printing, batch processing, compilers, xdisk usage. usage: hottip displays a list for which there are hottip topics usage: hottip [topic] displays local usage information example: hottip Matlab

icon: Locally-written, high-level language for processing data structures and character strings; see Icon Homepage

info: GNU Project hypertext documentation utility usage: info [command] options: "info c/r" gives directory of commands for which there is info; "info info" gives documention on the use of the utility example: info a2ps--to get GNU's documentation on the a2ps print utility

kill: Terminate a process usage: kill [options][process-id] options: -9 to terminate; using "0" for the PID kills all your processes example: kill -9 0--sends kill signal to processes started since login

javac / java: Java compiler and code processor usage: javac / java [options][files] options: see manpage example: java jcode--execute the Java program

ksh: Korn SHell usage: ksh [options][file] options: see manpage example: ksh kscript

lint: C source program checker usage: lint [options][file] options: -p check for portability | -b report unreachable breaks example: lint -p special.c--check code for portability

lp: Print file usage: lp [-ddestination] [file] send file to line printer options: -m send mail after printing | -c copies file before printing example: lp temp.txt--prints temp.txt to default printer

lpq: Display jobs in a print queue usage: lpq [options][-Pprintqueue]; if print queue is not specified, contents of default queue is displayed; get print-job# with this command needed to cancel a print job (see lprm) option: -l give long format example: lpq -l -P3hole--give long info on the "3hole" print queue

lpr: Print text or PostScript output to printer; see Printing Webpage for more options and examples options: -Pnohole (default queue) | -P3hole; see manpage also example: lpr chap1.pdf--prints PDF file on default print queue

lprm: Remove job from print queue usage: lprm [options][files] options: - remove all your jobs | -Pprintqueue indicate specific queue | job# indicate specific job (use lpq to get job#) example: lprm -Pnohole 412--remove job 412 from the nohole print queue

lpstat: Gives status of print jobs generated via the lp command usage: lpstat [options] options: see manpage example: lpstat -pnohole--gives printer status of nohole print queue

ls: Displays information about a directory (including descendants) or files; wildcards supported

usage: ls [options] [names]--names may be file or directory options: -a lists all entries, including .files (hidden) | -F labels directories(/), binaries(*), links(@) | -l give detailed info on each entry | -R recursively print subdirectories | -t display contents of directory sorted by time-modifi ed | -s display size in KB example: ls -la ~/ --gives detailed info on all hidden and regular descendants of your home directory example: ls -F ~/ --flags descendants as subdirectories, executables, links

mail: Send or receive email; reads mail on local machine only; cannot do IMAP usage: mail [options] [users] options: see manpage

man: Display "manual" info on a command; there are multiple levels or "sections" of commands-C, Fortran, and their commands, in general, come from the section "(3C++)" but system commands come from section "(1)"; s ee "printenv MANPATH" for the paths searched for manpages usage: man [options] [command] options: -k word shows names of all manpages that contain word | -a shows all manpages for this command from all sections | -M manpath shows the manpage from this specific path | -s section# shows the manpage from this specific section example: man a2ps | lpr--prints the a2ps manpage on the default printer (duplex, nohole) example: man -s 1 sort--displays info on sort from "section 1" (the Unix system's path) instead of "section 3C++" (the C++ path) which is the default for this command example: man -M /usr/share/man sort--displays info on sort from this explicit path (which overrides the default and effectively does the same as the previous command) example: man -a sort--displays info on sort from both section "3C++" and from "section 1" (the Unix system's path) example: man man--gives the manpage on man for complete information on its use (there's only a single level--no C++ version--of this command)

mkdir: Make directory usage: mkdir [dir] - makes directory with name dir options: -m allows you to set properties to the directory | -p allows you to create more then one directory at a time example: mkdir -p ~/first_dir/new_dir--creates new_dir inside of a new directory first_dir example: mkdir new_dir--makes new_dir inside the current directory

more / less / pg: Display file

usage: more [file] - displays the contents of a file in ASCII; use spacebar to advance by page, Enter to advance by line options: -c clear before displaying | -d display error messages | "h" gives help | "b" back example: more -c temp.txt--clears display then prints contents of file temp.txt

mutt: Mail User Agent; can do IMAP but not POP usage: mutt [options][users] options: see manpage

mv: Move file under a directory structure or to new file name; original (source) file will be gone usage: mv [file] [dir]--moves file under existing directory dir options: -f force copy over any existing file by that name | -i prompts user to copy over files example: mv temp.txt dir/ --moves temp.txt into directory dir/ example: mv -f temp.txt dir/ --moves temp.txt into directory dir/ erasing old temp.txt if it exists example: mv -i temp.txt dir/ --moves temp.txt into directory dir/ but asking before overwriting old temp.txt if it exists usage: mv [file1] [file2]--moves file1 to file2 example: mv temp.txt temp2.txt--renames temp.txt to temp2.txt example: mv -f temp.txt temp2.txt--renames temp.txt erasing old temp2.txt if it exists

ne: Full-screen text editor usage: ne [options][file] options: see manpage

nedit: GUI text editor which requires X-Windows usage: nedit [options][file] options: see manpage

nice: Run a command with modified priority usage: nice -n[value] [command] options: -nn--sets priority to n--value may range from 1 to 19 with 1 being highest priority and 10 the default example: nice -n 1 mysort--run the mysort program at the highest priority

nroff: Formats text usage: nroff [options] [files] options: see manpage example: nroff file | more--format file then display it

pack / unpack: Compress/expand a file usage: pack / unpack [options][file]--file may be an entire directory; produces output called file.z (versus ".Z" with compress); use unpack to expand file(s) options: -f force packing even if some files in directory would not benefit example: pack pdf.files/--pack the contents of the subdirectory, replacing each file with its compressed ".z" equivalent

passwd: Change password usage: passwd - brings up dialogue that allows you to change your password options: see manpage

pbs: Portable Batch System - allows submission, monitoring, and control of batch jobs on one or more systems usage: see manpage

perl: Perl language compiler usage: perl [options][program] options: see manpage

pgp: Pretty Good Privacy encryption system for email and data files usage: pgp [options][file] options: see manpage

pico: Full-screen (not GUI) text editor usage: pico [options][file] options: see manpage example: pico print-script--to edit the text file print-script

pine: Program for Internet News and Email email utility; can do IMAP but not POP usage: pine [options][addresses] options: see manpage example: pine--to invoke the pine email system

ping: Sends packets to a network host usage: ping [host] [timeout] (default for timeout is 20 seconds) options: timeout period in seconds example: ping 123.123.123.123 5--ping this IP address but give up after 5 seconds

pplinfo: Locally-written utility that displays whitepage people information usage: pplinfo [search-option] options: phone number | first and/or last names | full email address | entering pplinfo alone displays help information example: pplinfo burrito--returns whitepage info on all occurences of first or last name "burrito"

printenv: Display current settings of environment variables usage: printenv [variable]--if no environment variable is specified, all are displayed options: none example: printenv HOST--displays the name of the host on which you're running example: printenv MANPATH--displays the hierarchy of paths searched for manpages

procmail: Mail processor usage: procmail [options][users] options: see manpage

ps: Display processes usage: ps - displays running processes options: -u [user] display processes for user | -a display all processes example: ps--displays info about your process example: ps -u homer--displays all processes owned by homer example: ps -a--displays all processes running

pwd: Print working directory usage: pwd - displays current directory path options: none

rlogin: Remote Login See ssh

rm: Removes file(s) usage: rm [file] options: -i confirms erase | -r recursive erase example: rm -r cs120--deletes everything under cs120 and then cs120 itself

rmdir: Removes empty directory usage: rmdir [dir] - removes directory same as "rm -r dir" options: -p remove any parent directories which become empty because of this remove | -s suppress error msgs resulting from -p option example: rmdir -p cs120-1998/--remove this directory and any of its empty parents

scp: Secure remote copy usage: scp file options: example: scp

script: Stores current computing session in a file ("typescript" by default); Ctl_D to end logging usage: script [options] [file] options: -a append current session info to file example: script 6.21-log--store session log in file called 6.21-log

sed: Stream editor for text usage: sed [options][file] options: -e efile use edit commands found in efile | -s sfile run script commands found in sfile | -n suppress output example: sed

sendmail: Mail utility usage: sendmail [options][addresses] options: see manpage

setenv: Set environmental variables usage: setenv depends on shell options: see manpage example: setenv SHELL=/bin/bash--override the default SHELL setting to use the bash shell

setup: Local utility that establishes the paths and libraries needed by certain installed software. See the Installed Software list. Note that some software no longer requires setup to run properly. usage: setup [application] options: -h for help | -l for list of applications that can be setup example: setup ncar

sftp: Secure file transport which performs its operations over an encrypted SSH transport usage: sftp [options] [hostname | user@host] options: -v raise logging level | -C enable compression | -o ssh-option specify option to be passed to SSH example: sftp caterpillar.arizona.edu--initiate secure FTP session with the host caterpillar.arizona.edu

sh: Bourne Shell usage: sh [options] [args] options: see manpage example: sh -u--treat unset variables henceforth as errors rather than as nulls

ssh: Secure shell for remote logins; download this software at Sitelicense usage: ssh [-l login_name] [hostname | user@hostname] [command] options: see manpage example: ssh my-acct@u.arizona.edu--login as my-acct on the host u.arizona.edu

tail: Display file from a certain point usage: tail [location] [file] options: +n display n from beginning; -n display n from end of file example: tail--displays last screen's worth of .cshrc example: tail -10 .cshrc--displays last 10 lines of .cshrc

tar: "Tape Archiver"; bundles a collection of files into one unit ("tarfile") for archiving or transmitting usage: tar [options][tarfile][files] options: see manpage example: tar cf - . | gzip -c > test.tar.gz--bundles everything in the current directory, compresses it with gzip, creating a file called test.tar.gz example: tar xvf files.tar--extracts files fromfiles.tar

tcsh: C shell with file-name completion and command line editing usage: tcsh [options][args] options: see manpage

tee: Reproduces stdout in a file so that all the commands you enter and what is displayed as responses are logged usage: tee [options][file] options: -a append to output file file example: tee 6.21-log--begin logging what you enter into the file 6.21-log

telnet: Connect to another computer See ssh

tex / latex: Text formatting and typesetting languages usage: see manpages

touch: Change file access and modification times usage: touch [options] files - creates a blank file, or updates existing file options: -c do not create file if it does not exist | -t use time specified

example: touch new.txt creates file new.txt example: touch -c new.txt--updates new.txt node information to current time but does not create new.txt

troff: text formatting and typesetting language usage: see manpage

uname: Display host name and info of current system usage: uname options: -r print OS release level | -a prints basic info | -s prints the name of the OS (default) example: uname

unix2dos / dos2unix: File converters; takes Unix end-of-line characters and converts them to DOS end-of-line characters and vice versa usage: unix2dos [options] [file] options: -iso (default) uses ISO characters for Unix files | -ascii uses ASCII characters for Unix files example: unix2dos u-file d-file--converts ISO end-of-line characters in the Unix file u-file to DOS end-of-character files in the new file d-file

uudeview: decodes binary files encoded by uuencode and BinHex usage: uudeview [options] [files] options: see manpage

uuencode / uudecode: Encode/decode binary file for mail transmit; uudecode can process files packaged by uuencode, compress and tar usage: uuencode / uuencode [source-file] [destination-file] options: example: uuencode fin final | mail--encode the file fin, storing the result in final and piping that file to the mail utility

vi: Full-screen editor (not GUI) usage: vi [file]

options: -r retrieve last version of file after crash | -wn set window size to n example: vi cleanup-script

wc: Word Count usage: wc [option] [file] options: -l count the lines in the file | -w count the words | -c count the bytes | -m count characters | -lwc is the default example: wc freditor--count the lines, words and bytes of the file

what: Displays a one-line summary (the header line) of a command's manpage usage: what [command] options: none example: whatis whatis--summarizes the whatis command

whereis: Find path where source, executable or manpage reside which: Find path of executable usage: whereis(which) [options][file] options: -b binaries only | -m manpages only | -s source only example: whereis c321x--locates any source, binary and manpage on c321x example: whereis -m a2ps--look for location of manpage on a2ps

who / whoami: List people logged on to computer or how you are logged on usage: who usage: whoami

xdisk: Allocates temporary storage usage: xdisk [options] options: enter 'xdisk' to see list of options or see xdisk webpage example: xdisk create--allocates space of 100MB at /xdisk/$USER for 10 days (this amount and retention can change)

xv: Interactive image display; uses X-Windows usage: xv [options][files]

options: example: xv picture.jpg

xview: OpenWindows toolkit usage: not a command but a toolkit; see manpage

zcat / gzip / gunzip: GNU utilities to compress/uncompress files usage: zcat / gzip / gunzip [options][files] options: see manpages

zcmp / zdiff: Compares compressed files usage: zcmp / zdiff [options][files] options: use the options for cmp with zcmp and for diff with zdiff

zip / unzip: Compress and package/extract and uncompress files usage: zip / unzip [options][files] options: see manpage

You might also like