You are on page 1of 8

Prospective Students Current Students Faculty & Staff Alumni & Friends Home About People Academics Research

News Events Resources


Top of Form

Enter your
Bottom of Form

Hartley Conference Center Room Resources Computing Resources


News New Users Policies Network File Server Web Server Computing Labs Computational Clusters Get Help Net Connections Your Macintosh Your Windows PC Your Unix/Linux System Other School Resources

Using Unix

Overview Documentation Using the Shell Using X-Windows File Manipulation Net Commands Editing Text Formatting Text Printing Filters & Utilities Programming

Health and Safety

Common unix commands and utilities


Copyright Phillip Farrell. Last revision August 6, 2010 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)


^h, erase previously typed character backspace ^u ^d erase entire line of input so far typed end-of-input for programs reading from terminal

^s ^q ^z ^c ^\

suspend writing to terminal (freezes terminal) continue writing to terminal suspend currently running job; restart with bg or fg kill 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


login logout passwd kinit kdestroy access computer; start interactive session disconnect terminal session change local login password; you must set a strong password that is not easily guessed obtain kerberos ticket for connections to other kerberized computers destroy kerberos tickets (authorizations)

Information
date history man info w, who whoami top uptime show date and time list of previously executed commands show online documentation by program name online documentation for GNU programs who is on the system and what they are doing who is logged onto this terminal show system stats and top CPU using processes show one line summary of system status

File management
cat cp ls mv rm ln chmod crypt combine files copy files list files in a directory and their attributes change file name or directory location remove files create another link (name) to a file set file permissions encode/decode a file with a private key

gzip, gunzip compress/decompress a file

find

find files that match specific criteria

Display contents of files


cat more head tail vi pico grep lpr pr diff cmp comm od strings file wc copy files to display device show text file on display terminal with paging control show first few lines of a file(s) show last few lines of a file; or reverse line order full-featured screen editor for modifying text files simple screen editor for modifying text files display lines that match a pattern send file to printer format file with page headers, multiple columns, etc. compare two files and show differences compare two binary files and report if different compare two files; show common or unique lines display binary files as eqivalent octal/hex codes show printable text embedded in binary files examine file(s) and guess type: text, data, program, etc. count characters, words, and lines in a file

Directories
cd mkdir rmdir mv pwd change to new directory create new directory remove empty directory (you must remove files first) change name of directory show current directory

Disks
df du summarize free space on disk filesystems show disk space used by files or directories

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


* ~user $name match any characters in a file name shorthand for home directory of user substitute 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)


& ^c ^z fg bg ; () ! jobs ps kill nice at crontab limit alias sh, csh run job in background kill job in foreground suspend job in foreground restart suspended job in foreground run suspended job in background delimit commands on same line group commands on same line re-run earlier commands from history list list current jobs show process information kill background job or previous process run program at lower priority run program at a later time run program at specified intervals see or set resource limits for programs create alias name for program (normally used in .login file) execute command file

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


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

Email and communication


msgs mailx read system bulletin board messages send/read email; can be run by other programs to send exisiting files via email

uuencode uudecode rn

encode/decode a binary file for transmission via email read USENET news groups

Editors and formatting utilities


sed vi emacs xemacs pico fmt fold programmable text editor for data streams full-featured editor for character terminals GNU emacs editor for character terminals GNU emacs editor for X Window terminals very simple text editor fill and break lines to make all same length break long lines to specified length

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


xterm xauth xload xman xemacs gv xdvi gnuplot provide login shell window manipulate authorization files show system load full screen online manual viewer GNU emacs editor interface to contol gs to display PostScript or PDF files on screen display DVI files on X Window (screen preview) interactive data plotting on screen

TeX typesetting system


tex latex dvips xdvi process TeX files to DVI (device independent) output process LaTeX files to DVI print DVI files on Postscript laser printer display DVI files on X Window (screen preview)

latex2html translate LaTeX files to HTML (for web pages)

Printing (BSD based)


lpr lpq lprm enscript send file to print queue examine status of files in print queue remove a file from print queue convert text files to PostScript format for

printing

Interpreted languages and data manipulation utilities


sed awk perl sort tr cut paste dd programmable text editor for data streams pattern scanning and processing language Practical Extraction and Report Language sort or merge lines in a file(s) by specified fields translate characters cut out columns from a file paste columns into a file copy data between devices; reblock; convert EBCDIC

Graphics and mapping


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

Networking/communications
ssh scp sftp telnet ftp host lynx tar uuencode uudecode remote login/command execution; encrypted remote non-interactive file copy; encrypted remote interactive file copy; encrypted remote network login; plain text password - not recommended network file transfer program; plain text password - not recommended find IP address for given host name, or vice versa web browser for character based (text-only) terminals combine multiple files/dirs into single archive encode/decode a binary file for transmission via email

gzip, gunzip compress/decompress a file

Compilers, interpreters and programming tools


csh ksh sh f77 f2c command language interpreter (C-shell scripts) command language interpreter (Korn-shell scripts) command language interpreter (Borne-shell scripts) Fortran 77 compiler convert fortran source code to C source code

gcc g++ dbx make cflow

GNU C compiler GNU C++ compiler command-line symbolic debugger for compiled C or Fortran recompile programs from modified source generate C flow graph

Programming libraries (see man library_name)


lapack X dbm xdr netcdf Fortran 77 routines for numerical linear algebra (supersedes LINPACK and EISPACK) routines to interface with X window system (no man page -- get the X Toolkit book) database routines library routines for external data representation routines for machine independent data representation

Tape manipulation and archiving


mt dd tar ltf manipulate tape drive and position tape unformatted tape read and write; file conversion archive disk files on tape or disk read/write ANSI standard label tapes

You might also like