You are on page 1of 5

UNIX COMMANDS UNIX commands can often be grouped together to make even more powerful commands with capabilities

known as I/O redirection ( < for getting input from a file input and > for outputing to a file ) and piping using | to feed the output of one command as input to the next. Please investigate manuals in the lab for more examples than the few offered here. he following charts offer a summar! of some simple UNIX commands. hese are certainl! not all of the commands available in this robust operating s!stem" but these will help !ou get started.

Ten ESSENTIAL UNIX Commands


hese are ten commands that !ou reall! need to know in order to get started with UNIX. he! are probabl! similar to commands !ou alread! know for another operating s!stem. Comm and #. !s '. cd

E amp!e ls ls $al% cd tempdir cd .. cd (dh!att)web$docs mkdir graphics rmdir empt!dir cp file# web$docs cp file# file#.bak rm file#.bak rm 2.tmp mv old.html new.html more index.html lpr index.html man ls

Description &ists files in current director! &ist in long format *hange director! to tempdir +ove back one director! +ove into dh!att,s web$docs director! +ake a director! called graphics /emove director! (must be empt!) *op! file into director! +ake backup of file# /emove or delete file /emove all file +ove or rename files &ook at file" one page at a time 6end file to printer 8nline manual (help) about command

-. m"dir .. rmdir 0. cp 1. rm 3. m# 4. more 5. !pr #7. man

Ten $ALUA%LE UNIX Commands


8nce !ou have mastered the basic UNIX commands" these will be 9uite valuable in managing !our own account.

Command #. grep <str><&i!es> '. c'mod <opt> <&i!e> -. pass(d .. ps <opt>

E amp!e grep :bad word: 2 chmod 1.. 2.html chmod 300 file.exe passwd ps aux ps aux | grep dh!att kill $5 4.0gcc file.c $o file g>> fil'.cpp $o fil' g?ip bigfile gun?ip bigfile.g? mail me@tAhsst.edu < file# pine telnet vortex.tAhsst.edu ssh $l dh!att Aa??.tAhsst.edu ftp station#.tAhsst.edu ncftp metalab.unc.edu

Description %ind which files contain a certain word *hange file permissions read onl! *hange file permissions to executable *hange passwd &ist all running processes b! ;I< &ist process ;I<,s running b! dh!att =ill process with I< ;4.0*ompile a program written in * *ompile a program written in *>> *ompress file Uncompress file 6end file# b! email to someone /ead mail using pine 8pen a connection to vortex 8pen a secure connection to Aa?? as user dh!att Upload or <ownload files to station# *onnect to archives at UN*

0. "i!! <opt> <ID> 1. gcc )g**+ <so,rce> 3. g-ip <&i!e> 4. mai! )pine+ 5. te!net <'ost> ss' <'ost> #7. &tp <'ost> nc&tp <'ost/director .>

Ten /UN UNIX Commands


hese are ten commands that !ou might find interesting or amusing. he! are actuall! 9uite helpful at times" and should not be considered idle entertainment. Command #. ('o '. &inger E amp!e who finger Description &ists who is logged on !our machine &ists who is on computers in the lab

-. .ta!" <,ser0p!a ce> .. 'istor. 0. &ort,ne 1. date 3. ca! <mo> <.r> 4. e.es 5. ca!c #7. mpage <opt> <&i!e>

!talk dh!att@thr eat histor! fortune date cal 5 '777 xe!es B xcalc B mpage $4 file# | lpr

alk online with dh!att who is on threat

&ists commands !ou,ve done recentl! Print random humerous message Print out current date Print calendar for 6eptember '777 =eep track of cursor (in :background:) *alculator (:background: process) Print 4 pages on a single sheet and send to printer (the font will be smallC)

Ten 1EL2/UL UNIX Commands


hese ten commands are ver! helpful" especiall! with graphics and word processing t!pe applications. Command #. netscape '. # -. &ig / paint .. gimp 0. ispe!! <&name> 1. !ate <&name> 3. emacs / pico 4. so&&ice 5. m3too!s )mdir4 mcop.4 E amp!e netscape B xv B xfig B (xpaint B) gimp B ispell file# latex file.tex xemacs (or pico) soffice B mdir aD Description /un Netscape browser /un graphics file converter /un drawing program /un photoshop t!pe program 6pell check file# /un &a eX" a scientific document tool <ifferent editors /un 6tar8ffice" a full word processor <86 commands from UNIX (dir ED)

mde!4 m&ormat4 etc5 + #7. gn,p!ot

mcop! file# aD gnuplot

*op! file# to ED Plot data graphicall!

Ten USE/UL UNIX Commands6


hese ten commands are useful for monitoring s!stem access" or simplif!ing !our own environment. Command #. d& '. d, -. a!ias .. 'ost df du $b subdir alias llsH:ls $al%: xhost > threat.tAhsst.edu xhost $ fold $s file# | lpr tar $cf subdir.tar subdir tar $xvf subdir.tar gv filename.ps E amp!e Description 6ee how much free disk space Fstimate disk usage of director! in G!tes *reate new command :lls: for long format of ls Permit window to displa! from x$window program from threat Ellow no x$window access from other s!stems %old or break long lines at 17 characters and send to printer *reate an archive called subdir.tar of a director! Fxtract files from an archive file Iiew a Postscript file

0. &o!d 1. tar

3. g'ost#ie( )g#+ 4. ping )tracero,t e+

ping threat.tAhsst.edu traceroute www.!ahoo.co m top logout or exit

6ee if machine is alive Print data path to a machine

5. top #7. !ogo,t )e it+

Print s!stem usage and top resource hogs Jow to 9uit a UNIX shell.

You might also like