Sunteți pe pagina 1din 78

An A-Z Index of the Linux BASH command line

alias awk break builtin cal case cat cd chgrp chmod chown chroot cksum clear cmp comm command continue cp cron crontab csplit cut Create an alias Find and Replace text within file(s) Exit from a loop Run a shell builtin Display a calendar Conditionally perform a command Display the contents of a file Change Directory Change group ownership Change access permissions Change file owner and group Run a command with a different root directory Print CRC checksum and byte counts Clear terminal screen Compare two files Compare two sorted files line by line Run a command ignoring shell functions Resume the next iteration of a loop Copy one or more files to another location Daemon to execute scheduled commands !chedule a command to run at a later time !plit a file into context determined pieces Di"ide a file into se"eral parts

date Display or change the date # time dc Desk Calculator dd Data Dump Con"ert and copy a file declare Declare "ariables and gi"e them attributes df Display free disk space diff Display the differences between two files diff$ !how differences among three files dir %riefly list directory contents dircolors Colour setup for &ls' dirname Con"ert a full pathname to (ust a path dirs Display list of remembered directories du Estimate file space usage echo ed egrep e(ect enable en" e"al exec exit expand export expr Display message on screen ) line oriented text editor (edlin) !earch file(s) for lines that match an extended expression E(ect CD R*+ Enable and disable builtin shell commands Display, set, or remo"e en"ironment "ariables E"aluate se"eral commands-arguments Execute a command Exit the shell Con"ert tabs to spaces !et an en"ironment "ariable E"aluate expressions

factor false fdformat fdisk fgrep find fmt fold for format free fsck function gawk getopts grep groups g1ip hash head history hostname id if import info install (oin kill less let ln local locate logname logout lpc lpr lprint lprintd lprint5 lprm ls m6 man mkdir mkfifo mknod more mount

Print prime factors Do nothing, unsuccessfully .ow le"el format a floppy disk Partition table manipulator for .inux !earch file(s) for lines that match a fixed string !earch for files that meet a desired criteria Reformat paragraph text /rap text to fit a specified width0 Expand words, and execute commands Format disks or tapes Display memory usage Filesystem consistency check and repair0 Define Function +acros Find and Replace text within file(s) Parse positional parameters !earch file(s) for lines that match a gi"en pattern Print group names a user is in Compress or decompress named file(s) Remember the full pathname of a name argument *utput the first part of file(s) Command 2istory Print or set system name Print user and group id's Conditionally perform a command Capture an 3 ser"er screen and sa"e the image to file 2elp info Copy files and set attributes 4oin lines on a common field !top a process from running Display output one screen at a time Perform arithmetic on shell "ariables +ake links between files Create "ariables Find files Print current login name Exit a login shell .ine printer control program *ff line print Print a file )bort a print (ob .ist the print 5ueue Remo"e (obs from the print 5ueue .ist information about file(s) +acro processor 2elp manual Create new folder(s) +ake F7F*s (named pipes) +ake block or character special files Display output one screen at a time +ount a file system

mtools m" nice nl nohup passwd paste pathchk popd pr printcap printen" printf ps pushd pwd

+anipulate +! D*! files +o"e or rename files or directories !et the priority of a command or (ob 8umber lines and write files Run a command immune to hangups +odify a user password +erge lines of files Check file name portability Restore the pre"ious "alue of the current directory Con"ert text files for printing Printer capability database Print en"ironment "ariables Format and print data Process status !a"e and then change the current directory Print /orking Directory

5uota Display disk usage and limits 5uotacheck !can a file system for disk usage 5uotactl !et disk 5uotas ram rcp read readonly remsync return rm rmdir rpm rsync screen sdiff sed select se5 set shift shopt shutdown sleep sort source split su sum symlink sync tac tail tar tee test ram disk de"ice Copy files between two machines0 read a line from standard input +ark "ariables-functions as readonly !ynchroni1e remote files "ia email Exit a shell function Remo"e files Remo"e folder(s) Remote Package +anager Remote file copy (!ynchroni1e file trees) 9erminal window manager +erge two files interacti"ely !tream Editor )ccept keyboard input Print numeric se5uences +anipulate shell "ariables and functions !hift positional parameters !hell *ptions !hutdown or restart linux Delay for a specified time !ort text files Run commands from a file &0' !plit a file into fixed si1e pieces !ubstitute user identity Print a checksum for a file +ake a new name for a file !ynchroni1e data on disk with memory Concatenate and write files in re"erse *utput the last part of files 9ape )Rchi"er Redirect output to multiple files E"aluate a conditional expression

time +easure Program Resource :se times :ser and system times touch Change file timestamps top .ist processes running on the system traceroute 9race Route to 2ost trap Run a command when a signal is set(bourne) tr 9ranslate, s5uee1e, and-or delete characters true Do nothing, successfully tsort 9opological sort tty Print filename of terminal on stdin type Describe a command ulimit umask umount unalias uname unexpand uni5 units unset unshar until useradd usermod users uuencode uudecode " "dir watch wc whereis which while who whoami xargs yes 0period <<< .imit user resources :sers file creation mask :nmount a de"ice Remo"e an alias Print system information Con"ert spaces to tabs :ni5uify files Con"ert units from one scale to another Remo"e "ariable or function names :npack shell archi"e scripts Execute commands (until error) Create new user account +odify user account .ist users currently logged in Encode a binary file Decode a file created by uuencode ;erbosely list directory contents (&ls ;erbosely list directory contents (&ls l l b') b')

Execute-display a program periodically Print byte, word, and line counts Report all known instances of a command .ocate a program file in the user's path0 Execute commands Print all usernames currently logged in Print the current user id and name (&id un') Execute utility, passing constructed argument list(s) Print a string until interrupted Run commands from a file Comment - Remark

An A-Z Index of the Linux BASH command line with examples


alias Create an alias

alias Create an alias, aliases allow a string to e su stituted for a word when it is used as the first word of a simple command!
!=89)3 alias > p? >name>@"alue? 000? unalias > a? >name 000 ?

If arguments are supplied, an alias is defined for each name whose "alue is gi"en! If no "alue is gi"en, #alias$ will print the current "alue of the alias! %ithout arguments or with the #-p$ option, alias prints the list of aliases on the standard output in a form that allows them to e reused as input! #unalias$ will remo"e each name from the list of aliases! If & a' is supplied, all aliases are remo"ed! #alias$ and #unalias$ are BASH uilt-ins! &he first word of each simple command, if un'uoted, is chec(ed to see if it has an alias! If so, that word is replaced ) the text of the alias! &he alias name and the replacement text ma) contain an) "alid shell input, including shell metacharacters, with the exception that the alias name ma) not contain #*$! &he first word of the replacement text is tested for aliases, ut a word that is identical to an alias eing expanded is not expanded a second time! &his means that one ma) alias ls to +ls -,+, for instance, and Bash does not tr) to recursi"el) expand the replacement text! If the last character of the alias "alue is a space or ta character, then the next command word following the alias is also chec(ed for alias expansion! &here is no mechanism for using arguments in the replacement text, as in csh! If arguments are needed, a shell function should e used ! Aliases are not expanded when the shell is not interacti"e, unless the expand-aliases shell option is set using shopt ! &he rules concerning the definition and use of aliases are somewhat confusing! Bash alwa)s reads at least one complete line of input efore executing an) of the commands on that line! Aliases are expanded when a command is read, not when it is executed! &herefore, an alias definition appearing on the same line as another command does not

ta(e effect until the next line of input is read! &he commands following the alias definition on that line are not affected ) the new alias! &his eha"ior is also an issue when functions are executed! Aliases are expanded when a function definition is read, not when the function is executed, ecause a function definition is itself a compound command! As a conse'uence, aliases defined in a function are not a"aila le until after that function is executed! &o e safe, alwa)s put alias definitions on a separate line, and do not use alias in compound commands! ,or almost e"er) purpose, shell functions are preferred o"er aliases! Examples alias ls*$ls -,$ .ow issuing the command $ls$ will actuall) run $ls -,$ /a(ing an alias permanent0 1se )our fa"orite text editor to create a .bash_aliases file, and t)pe the alias commands into the file! .bash_aliases will run at login 2or )ou can 3ust execute it with ..bash_aliases 4 "The odds against there being a bomb on a plane are a million to one, and against two bombs a million times a million to one. Next time you fly, cut the odds and take a bomb." - Benny Hill Related commands0 export - Set an en"ironment "aria le en" - 5ispla), set, or remo"e en"ironment "aria les echo - 5ispla) message on screen readonl) - /ar( "aria les6functions as readonl) shift - Shift positional parameters Equivalent Windows NT commands0 S7& - 5ispla), set, or remo"e %indows .& en"ironment "aria les S7&8 - Set en"ironment "aria les permanentl) S7&L9CAL - Begin localisation of en"ironment changes in a atch file

awk

Find and Replace text within file(s)

gaw( 2gnu aw(4 ,ind and :eplace text within file2s4

!=89)3

awk A*ptionsB 'PR*CR)+' awk A*ptionsB 'PR*CR)+' 7nput FileD 7nput FileE 000

7f no 7nput File is specified then &awk' applies the PR*CR)+ to the Fstandard inputF, this can either be the piped output of some other command or whate"er you type on the terminal0 9yped input will continue until you indicate end of file by typing &Control d'0 GE= & F F!' & field separator F!' :se F! for the input field separator (the "alue of the &F!' predefined "ariable)0 & f PR*CR)+ F7.E' & file PR*CR)+ F7.E' Read the &awk' program source from the file PR*CR)+ F7.E, instead of from the first command line argument0 & mf 888' & mr 888' 9he &f' flag sets the maximum number of fields, and the &r' flag sets the maximum record si1e0 9hese options are ignored by &gawk', since &gawk' has no predefined limitsH they are only for compatibility with the %ell .abs research "ersion of :nix &awk'0 & " ;)R@;).' & assign ;)R@;).' )ssign the "ariable ;)R the "alue ;). before program execution begins0 & / traditional' & / compat' & traditional' & compat' :se compatibility mode, in which &gawk' extensions are turned off0 & / lint' & lint' Ci"e warnings about dubious or non portable &awk' constructs0 & / lint old' & lint old' /arn about constructs that are not a"ailable in the original ;ersion I :nix "ersion of &awk'0 & / posix' & posix' :se P*!73 compatibility mode, in which &gawk' extensions are turned off and additional restrictions apply0 & / re inter"al' & re inter"al' )llow inter"al expressions, in regexps0

& / source@PR*CR)+ 9E39' & source PR*CR)+ 9E39' :se PR*CR)+ 9E39 as &awk' program source code0 9his option allows mixing command line source code with source code from files, and is particularly useful for mixing command line programs with library functions0 & ' !ignal the end of options0 9his is useful to allow further arguments to the &awk' program itself to start with a & '0 9his is mainly for consistency with P*!73 argument parsing con"entions0 'PR*CR)+' a series of patterns and actionsJ

PROGRA

patte!ns and actions

&he ;:9<:A/ statement that tells #aw($ what to do consists of a series of +rules+! 7ach rule specifies one pattern to search for, and one action to perform when that pattern is found! ,or ease of reading, each line in an #aw($ program is normall) a separate ;:9<:A/ statement , li(e this0
P)99ER8 K )C97*8 L P)99ER8 K )C97*8 L 000 2owe"er, &gawk' will ignore newlines after any of the followingJ , K M J NN ## do else e0g0 E patterns each followed by an actionJ awk '-DO- K print PQ L -6Q- K print PQ L' %%! list

A regular expression enclosed in slashes 2#6$4 is an #aw($ pattern that matches e"er) input record whose text elongs to that set! e!g! the pattern 6foo6 matches an) input record containing the three characters #foo$, =an)where= in the record! Comments - start with a #>$, and continue to the end of the line0
< 9his program prints a nice friendly message0

#aw($ patterns ma) e one of the following0


-REC:.)R E3PRE!!7*8P)99ER8 ## P)99ER8 P)99ER8 NN P)99ER8 R P)99ER8 P)99ER8 M P)99ER8 J P)99ER8 +atch @ )8D *R 8*9 7f, 9hen, Else

P)99ER8D, P)99ER8E %EC78 E8D

Range !tart end Perform action %EF*RE input file is read Perform action )F9ER input file is read

In addition to simple pattern matching #aw($ has a huge range of text and arithmetic ,unctions, ?aria les and 9perators! ,or full details see the in"o documentation
) few examples000 9his program prints the length of the longest input lineJ awk 'K if (length(PQ) B max) max @ length(PQ) L E8D K print max L' data 9his program prints e"ery line that has at least one field0 9his is an easy way to delete blank lines from a file (or rather, to create a new file similar to the old file but from which the blank lines ha"e been deleted) awk '8F B Q' data 9his program prints se"en random numbers from 1ero to DQQ, inclusi"e0 awk '%EC78 K for (i @ DH i A@ IH iSS) print int(DQD T rand()) L' 9his program prints the total number of bytes used by F7.E!0 ls lg F7.E! N awk 'K x S@ PO L H E8D K print Ftotal bytesJ F x L'

9his program prints a sorted list of the login names of all users0 awk FJ 'K print PD L' -etc-passwd N sort 9his program counts lines in a file0 awk 'E8D K print 8R L' data 9his program prints the e"en numbered lines in the data file0 7f you were to use the expression &8R U E @@ D' instead, it would print the odd numbered lines0 awk '8R U E @@ Q' data

" ustice is such a fine thing that we cannot pay too dearly for it - !lain-"ene #esage Related commands0 #aw($, #oaw($, and #naw($ - Alternati"e, older and newer "ersions of aw( egrep - egrep foo ,IL7S !!!is essentiall) the same as aw( $6foo6$ ,IL7S !!!

expr - 7"aluate expressions e"al - 7"aluate se"eral commands6arguments for - 7xpand words, and execute commands grep - search file2s4 for lines that match a gi"en pattern m@ - /acro processor tr - &ranslate, s'ueeAe, and6or delete characters Equivalent Windows NT commands0 ,9: - Conditionall) perform a command se"eral times S7& - 5ispla), set, or remo"e %indows .& en"ironment "aria les

break

Exit from a loop

rea( 7xit from a for, while, until, or select loop


!=89)3 break >n?

If n is supplied, the nth enclosing loop is exited! n must e greater than or e'ual to B! &he return status is Aero unless n is not greater than or e'ual to B! Example
for myloop in D E $ 6 O do echo n FPmyloopF if > FPmyloopF e5 $ ? then break < 9his line will break out of the loop fi done

rea( is a ;9SI8 #special$ uiltin "$on%t worry about the world coming to an end today. &t%s already tomorrow in !ustralia." - 'harles (chult) Related commands0 for - 7xpand words, and execute commands select - Accept (e) oard input until - 7xecute commands 2until error4

while - 7xecute commands continue - :esume the next iteration of a loop Equivalent Windows NT command0 <9&9 - 5irect a atch program to 3ump to a la elled line

builtin

Run a shell builtin

uiltin :un a shell uiltin, passing it args, and return its exit status!
!=89)3 builtin >shell builtin >args??

&his is useful when defining a shell function with the same name as a shell uiltin, retaining the functionalit) of the uiltin within the function!
For example, to write a function to replace &cd' that writes the hostname and current directory to an xterm title barJ cd() K builtin cd FPVF ## xtitle FP2*!9J PP/DF L

&he return status is non-Aero if shell- uiltin is not a shell uiltin command! Related commands0 chroot - :un a command with a different root director) cron - 5aemon to execute scheduled commands exec - 7xecute a command if - Conditionall) perform a command nohup - :un a command immune to hangups su - :un a command with su stitute user and group id shopt - Shell 9ptions !source - :un commands from a file t)pe - 5escri e a command watch - 7xecute6displa) a program periodicall)

Equivalent Windows NT command0 CALL - Call one atch program from another

cal case cat cd chgrp chmod chown chroot cksum clear cmp comm command continue cp cron crontab csplit cut

Display a calendar Conditionally perform a command Display the contents of a file Change Directory Change group ownership Change access permissions Change file owner and group Run a command with a different root directory Print CRC checksum and byte counts Clear terminal screen Compare two files Compare two sorted files line by line Run a command ignoring shell functions Resume the next iteration of a loop Copy one or more files to another location Daemon to execute scheduled commands !chedule a command to run at a later time !plit a file into context determined pieces Di"ide a file into se"eral parts

date Display or change the date # time dc Desk Calculator dd Data Dump Con"ert and copy a file declare Declare "ariables and gi"e them attributes df Display free disk space diff Display the differences between two files diff$ !how differences among three files dir %riefly list directory contents dircolors Colour setup for &ls' dirname Con"ert a full pathname to (ust a path dirs Display list of remembered directories du Estimate file space usage echo ed egrep e(ect enable en" e"al exec exit expand export expr factor false fdformat fdisk Display message on screen ) line oriented text editor (edlin) !earch file(s) for lines that match an extended expression E(ect CD R*+ Enable and disable builtin shell commands Display, set, or remo"e en"ironment "ariables E"aluate se"eral commands-arguments Execute a command Exit the shell Con"ert tabs to spaces !et an en"ironment "ariable E"aluate expressions Print prime factors Do nothing, unsuccessfully .ow le"el format a floppy disk Partition table manipulator for .inux

fgrep find fmt fold for format free fsck function gawk getopts grep groups g1ip hash head history hostname id if import info install (oin kill less let ln local locate logname logout lpc lpr lprint lprintd lprint5 lprm ls m6 man mkdir mkfifo mknod more mount mtools m" nice

!earch file(s) for lines that match a fixed string !earch for files that meet a desired criteria Reformat paragraph text /rap text to fit a specified width0 Expand words, and execute commands Format disks or tapes Display memory usage Filesystem consistency check and repair0 Define Function +acros Find and Replace text within file(s) Parse positional parameters !earch file(s) for lines that match a gi"en pattern Print group names a user is in Compress or decompress named file(s) Remember the full pathname of a name argument *utput the first part of file(s) Command 2istory Print or set system name Print user and group id's Conditionally perform a command Capture an 3 ser"er screen and sa"e the image to file 2elp info Copy files and set attributes 4oin lines on a common field !top a process from running Display output one screen at a time Perform arithmetic on shell "ariables +ake links between files Create "ariables Find files Print current login name Exit a login shell .ine printer control program *ff line print Print a file )bort a print (ob .ist the print 5ueue Remo"e (obs from the print 5ueue .ist information about file(s) +acro processor 2elp manual Create new folder(s) +ake F7F*s (named pipes) +ake block or character special files Display output one screen at a time +ount a file system +anipulate +! D*! files +o"e or rename files or directories !et the priority of a command or (ob

nl nohup passwd paste pathchk popd pr printcap printen" printf ps pushd pwd

8umber lines and write files Run a command immune to hangups +odify a user password +erge lines of files Check file name portability Restore the pre"ious "alue of the current directory Con"ert text files for printing Printer capability database Print en"ironment "ariables Format and print data Process status !a"e and then change the current directory Print /orking Directory

5uota Display disk usage and limits 5uotacheck !can a file system for disk usage 5uotactl !et disk 5uotas ram rcp read readonly remsync return rm rmdir rpm rsync screen sdiff sed select se5 set shift shopt shutdown sleep sort source split su sum symlink sync tac tail tar tee test time times touch top ram disk de"ice Copy files between two machines0 read a line from standard input +ark "ariables-functions as readonly !ynchroni1e remote files "ia email Exit a shell function Remo"e files Remo"e folder(s) Remote Package +anager Remote file copy (!ynchroni1e file trees) 9erminal window manager +erge two files interacti"ely !tream Editor )ccept keyboard input Print numeric se5uences +anipulate shell "ariables and functions !hift positional parameters !hell *ptions !hutdown or restart linux Delay for a specified time !ort text files Run commands from a file &0' !plit a file into fixed si1e pieces !ubstitute user identity Print a checksum for a file +ake a new name for a file !ynchroni1e data on disk with memory Concatenate and write files in re"erse *utput the last part of files 9ape )Rchi"er Redirect output to multiple files E"aluate a conditional expression +easure Program Resource :se :ser and system times Change file timestamps .ist processes running on the system

traceroute 9race Route to 2ost trap Run a command when a signal is set(bourne) tr 9ranslate, s5uee1e, and-or delete characters true Do nothing, successfully tsort 9opological sort tty Print filename of terminal on stdin type Describe a command ulimit umask umount unalias uname unexpand uni5 units unset unshar until useradd usermod users uuencode uudecode " "dir watch wc whereis which while who whoami xargs yes 0period <<< .imit user resources :sers file creation mask :nmount a de"ice Remo"e an alias Print system information Con"ert spaces to tabs :ni5uify files Con"ert units from one scale to another Remo"e "ariable or function names :npack shell archi"e scripts Execute commands (until error) Create new user account +odify user account .ist users currently logged in Encode a binary file Decode a file created by uuencode ;erbosely list directory contents (&ls ;erbosely list directory contents (&ls l l b') b')

Execute-display a program periodically Print byte, word, and line counts Report all known instances of a command .ocate a program file in the user's path0 Execute commands Print all usernames currently logged in Print the current user id and name (&id un') Execute utility, passing constructed argument list(s) Print a string until interrupted Run commands from a file Comment - Remark

A a2p ab ac adddefpriv addpriv addprivuser addr2line addresses addwords

aimk ainfo akill analyze.pl animate ansi2knr ar arch array arshell as ascheck asn1parse at atq atrm attr aucat audbin augrep aumix option>[[ !"#[##!!$[ecord#!%[lay#!q[uery## ["dh&'q... autoexpect autofsd"probe B backend bash batch bcfree bison build(cmgr(script builtins " bash built"in commands) see bash*1+ busybox C c filt c2ph ca ,-.pl cal cancel"cups cannacheck cannakill cannaserver cannastat capinfos captoinfo catdic cbeutil cdb.ackup

cdbconfig cdb$estore cdbutil cdda2wav cdparanoia cdrecord cert2ldap certfind chacl chage chatr chattr checkpriv chfn chkhelp chrt chsh chvt ciphers c/peg clear clusterdb clustervis cluster(mgr cluster(status cmond cms(failconf col colcrt colrm column combine(profile.pl compile(et composite compress con/ure 0-$1&123 ,on/ure and 45' are in very early development and the syntax is... consoletype convert cpdic cpio cpp cpuset createdb createlang createuser crl crl2pkcs6 crontab crsd csacom csh cshost

ctow curl curl"config cvs D dbiprof dbiproxy dbish dbpmda dc(client dc(server dc(snoop dc(test ddate deallocvt delwords dgst dhparam dicar diffpp dig diskstat dislocate display d/peg dkvis dlook dlpsh doexec dpbindic dplace dprofpp dpromdic dropdb droplang dropuser dsa dsaparam dumpkeys dvipdf E ecpg editcap emacs enc enc2xs enscript eps2eps

escputil esd esd"config esdcat esdctl esddsp esdfilt esdloop esdmon esdplay esdrec esdsample esparchive espconfig with the 75% database. 8he "sgmclient option specifies the client ali... esplogger esplognote espnotify espquery espreport interacts with the 75% database espsysid etags ethereal evanalyzer event9iew evgraph evhist evim evmerge evpp ex expect expectk F fam fax2ps fax2tiff fc"cache fc"list fgconsole filter find2perl findsmb finger font2c free fs2d G

g66 gaim gaim"remote gamma:scanimage gcc gc/ gc/h gcov gdb gdbserver gdbtui gdk"pixbuf"csource gedit 8he gedit application is a simple text editor. ;ou can use gedit to cr... gendiff gendsa genhostid genrsa getent getfacl getfattr getopt gfdl 9ersion 1.1) 4arch 2<<< ,opyright *c+ 2<<< =ree 5oftware =oundation) &nc.... gfxinfo gfxtopology ghostscript gif2tiff gi/ gimp gimp"1.2 gimp"remote gimp"remote"1.2 gimpprint"config gimptool gimptool"1.2 g/ar gnome"panel gnome"panel"preferences gnuserv gpasswd gphoto2 gpilot"install"file gpm"root gprof grep grep/ar grmic grmiregistry gs gs"pcl> gsb/ " =ormat and print text for ?esk@et printer using ghostscript gsd/A<< " ... gsd/ " =ormat and print text for ?esk@et printer using ghostscript gsd/A<< " ... gsd/A<< " =ormat and print text for ?esk@et printer using ghostscript gsd/A<< " ... gsl/ " =ormat and print text for ?esk@et printer using ghostscript gsd/A<< " ...

gslp " =ormat and print text for ?esk@et printer using ghostscript gsd/A<< " ... gsnd gst"complete gst"compprep gst"feedback gst"inspect gst"launch gst"launch"ext gst"mdAsum gst"register gst"visualise gst"xmllaunch gtk"config gtopology gvim gvimdiff H h2ph h2xs ha5tatus ha(cilog ha(cmsd ha(exec2 ha(gcd ha(ifd ha(ifdadmin ha(macconfig2 ha(srmd hesinfo hexdump file hinotes hinv host hostname " show the system htdigest htpasswd hyperpipeinfo I iconv identify idl2eth ietf2datebook i/sgimpprint &mage4agick imlib"config imlib(config import infocmp

infotocap initdb initlocation initlog install"datebook install"expenses time install"hinote install"memo install"netsync install"user intro iostat ipcalc ipcclean irb isamchk all tables on the command will be checked for errors isamlog iscsi"ls J /a /cf"dump /kill /macs /oe /pegtran /pico /star /stat /v"convert /v"scan /wait K kbd(mode kernelversion kibitz kill L lastcomm launch75%artner lcrash ld ldapadd ldapdelete ldapmodify ldapmodrdn ldappasswd

ldapsearch ldd less lesskey libnetcfg linkstat listclients lkcd(config lkcd(ksyms loaderinfo loadkeys locale localedef logger login logresolve look lp"cups lpoptions lppasswd lpq"cups lpr"cups lprm"cups lpstat"cups lrelease lsattr lsb(release lsdic lupdate lynx M 4agick "config 4agick"config mailq.sendmail makemap.pl man1Bgpasswd man1Bhostname " mostra ou configura o nome do dom man1Bsg mcookie md2 md: mdA mdc2 mergecap mev mikmod mkaf mkbindic mkdic mkpasswd mkromdic

moc mogrify montage more mozilla 4%& mpimon mpirun mpivis mpstat mpvis mtx multixterm mvdic mysql mysqlaccess mysqladmin mysqld mysqldump mysqld(multi mysqlshow columns+ mysql(zap N namei nasm ndisasm netreport newaliases.sendmail newgrp newhelp nfsvis nm nmblookup nodevis nseq nslookup ntlm(auth ntpd ntpdate " 1etwork 8ime %rotocol *18%+ daemon page. -fter a suitable period of ... ntpdc ntpq ntpstat ntptime ntptrace O ob/copy ob/dump ocsp

oglsnoop omp omprun ompstartdmx ompwrapwm omshell onsgmls open/ade openssl openvt opmview oprofile op(visualise osgmlnorm ospam ospent osvis osx oview oview:sn< oview(layout P pal2rgb parse passmass passwd pcl>opts pcp %,%&ntro pcpintro pcregrep pcretest pdf2dsc pdf2ps pdffonts pdfimages pdfinfo pdfopt pdftopbm pdftops pdftotext pdl m" bers are the most effectualCD " %liny the 7lder %?'33-%& %?'33.ad9alues %?'33?ataflow %?'33?elta %?'33=-E %?'33&mpatient %?'33&ndexing %?'33&nternals %?'33Fb/ects

%?'33%hilosophy %?'33%% %?'33%%"&nline %?'338ips pdldoc perfly perl perlA<<:delta perlA<<Adelta perlAG1delta perlAGdelta perlA6<delta perlA61delta perlA62delta perlA6>delta perlAHdelta perlaix perlamiga perlapi perlapio perlapollo perlbeos perlbook perlboot perlbot perlbs2<<< perlbug perlcall perlcc perlce perlclib perlcn perlcompile perlcygwin perldata perldbmfilter perldebguts perldebtut perldebug perldelta perldgux perldiag perldl perldoc perldos perldsc perlebcdic perlembed perlepoc perlfaq perlfaq1 perlfaq2 perlfaq>

perlfaq: perlfaqA perlfaqG perlfaq6 perlfaqH perlfaqI perlfilter perlfork perlform perlfreebsd perlfunc perlguts perlhack perlhist perlhpux perlhurd perlintern perlintro perliol perlipc perlirix perlivp perl/p %erl A.H.< perlko perllexwarn perllocale perllol perlmachten perlmacos perlmint perlmod perlmodinstall perlmodlib perlmodstyle perlmpeix perlnetware perlnewmod perlnumber perlob/ perlop perlopentut perlos2 perlos>I< perlos:<< perlothrtut perlpacktut perlplanI perlpod perlpodspec perlport perlqnx perlre perlref

perlreftut perlrequick perlretut perlrun perlsec perlsolaris perlstyle perlsub perlsyn perlthrtut perltie perltoc perltodo perltooc perltoot perltrap perltruG: perltw perlunicode perluniintro perlutil perluts perlvar perlvmesa perlvms perlvos perlwin>2 perlxs perlxstut perror pf2afm pfbtopfa pfconv pfmon pgrep pgtclsh pg(config pg(controldata pg(ctl pg(dump pg(dumpall pg(resetxlog pg(restore pi"getram pi"getrom piconv pilot"addresses dera) 8$2%ro) 5ony or other %alm ,ompatible Jandheld %?- device pilot"xfer or other %alm ,ompatible Jandheld %?- device pkcs12 pkcs6 pkcsH pl2pm play " record audio to any sound file format

pmafm pmap pmcd pmcd(wait pmchart pmclient pmdabrocade pmdacisco pmdaespping pmdamailq pmdampi pmdasample pmdasendmail pmdashping pmdasimple pmdasnia pmdasummary pmdate pmdatrace pmdatrivial pmdatxmon pmdaweblog pmdbg pmdumplog pmdumptext pmerr pmgadgets pmgcisco pmgcluster pmgenmap pmgevctr pmgirix pmgshping pmgsys pmgxvm pmhostname pmie pmieconf pmie(check pminfo pmkstat pmlc pmlock pmlogcheck pmlogconf pmlogextract pmlogger pmlogger(check pmlogger(daily pmlogger(merge pmlogsummary pmnewlog pmnsadd

pmnscomp pmnsdel pmnsmerge pmpost pmprobe pmshub pmsnap pmsocks pmstat pmstore pmtime pmtrace pmval pmview pmview pod2html pod2latex pod2man pod2text pod2usage podchecker podselect postalias postcat postconf postdrop postfix postgres postkick postlock postlog postmap postmaster postqueue postsuper ppm2tiff pptemplate printafm probe profile.pl profiles ps " report process status ps2ascii ps2epsi ps2pdf " ,onvert %ost5cript to %?= 1.> *-crobat :"and"later compati" ble+ using... ps2pdf12 " ,onvert %ost5cript to %?= 1.> *-crobat :"and"later compati" ble+ using... ps2pdf1> " ,onvert %ost5cript to %?= 1.> *-crobat :"and"later compati" ble+ using... ps2pdfwr ps2ps psed psfaddtable

psfgettable psfstriptable psfxtable psql pstruct %94 pvm pvmd pvmd> pvm(intro pvm(shmd python Q quota R radclient radeapclient radlast radtest radwho radzap ranlib ras2tiff rcp rcp ["px# ["r# file ... directory rdist rd/pgcom read"ical read"notepad newer devices+. -lternately) if no options are given) each record read"palmpix type is %ortable %ixmap *.ppm+ readcd readelf readprofile rec " record audio to any sound file format rename replace files or on the standard input. Kses a finite state machine to match lo... req reset rev rexec rgb2ycbcr ripemd1G< r/oe rlogin rmdefpriv rmdic rmpriv rmprivuser routervis

rpcclient rpcgen rsa rsautl rsh rsvg rsync ruby runpriv rup rusers rvi rview rvim S s2p sa"learn safe(mysqld sane"config sane"find"scanner saned sar scanimage scp ["i identity(file# ["l limit# ["o ssh(option# [[userL#host13#file1 [...#... script scrollkeeper"config scrollkeeper"gen"seriesid scsitape sendmail sensors sess(id setfacl setfattr setleds setmetamode setmon " set the current and default video output format setterm sftp [". buffer(size# ["= ssh(config# ["% sftp(server path# ["$ num(requests... sgi2tiff sgmlnorm sh sha sha1 showkey shubstats size skill " report process status slabtop sliceprint slogin ssh ["afgknqstvx-,18M12:G# ["b bind(address# ["c cipher(spec# ["e escape...

smbcacls smbclient smbcontrol smbcquotas smbstatus smbtar smbtree smime snmpbulkget snmpbulkwalk snmpcmd snmpdelta snmpdf snmpget snmpgetnext snmpnetstat snmpset snmpstatus snmptable snmptest snmptranslate snmptrap snmpusm snmpwalk sox soxexam soxmix spamassassin spamc spamd speed spkac splain " standalone program to do the same thing splitword sprof ssh ssh ["afgknqstvx-,18M12:G# ["b bind(address# ["c cipher(spec# ["e escape... ssh"add ssh"add "s reader ssh"add "e reader ssh"agent ssh"agent ["c ! "s# "k ssh"keygen ["f output(keyfile# ssh"keygen "p ["% old(passphrase# ["1 new(passphrase# ["... ssh"keyscan [host ! addrlist namelist# [...# sslpasswd sslrand states strace strings strip sysadmd s(client s(server T

tack tapeinfo taskset tclsh " 5imple shell containing 8cl interpreter tcsh telnet"probe testlibraw testparm testprns tethereal text2pcap tftp thumbnail tic tickad/ tiff2bw tiff2ps tiff2rgba tiffcmp tiffcp tiffdither tiffdump tiffgt tiffinfo tiffmedian tiffsplit tiffsv time tknewsbiff tload toe top topdisk topology topsys tput tset txmonvis U ud uic ul unbuffer uncompress unicode(start unicode(stop uptime userinfo usermount userpasswd

usleep uuidgen V vacuumdb verify version vfstest vi view vim vimdiff vimtutor vizserver vncconfig vncpasswd vncserver vncviewer vsadmin vscfg vsmonitor vsserver vsx W watch wbinfo weblogvis webvis wftopfa whereis wish " 5imple windowing shell wmxmms write wr/pgcom wtoc X x<vncserver xA<I xaumix xbowvis xcftopnm xemacs xkibitz xlv(vis xml2"config xmlcatalog xmllint

xmlwf xmms xpdf xsltproc xsubpp xvcinfo Mvnc xxd Y ypcat ypmatch yppasswd ypwhich Z zip

7mail article lin(

Alphabetical Directory of Linux Commands


&his director) of Linux commands is from Linux in a .utshell, @th 7dition! Clic( on an) of the CBC commands elow to get a description and list of a"aila le options! All lin(s in the command summaries point to the online "ersion of the oo( on Safari Boo(shelf!

Bu) it now, or read it online on Safari Boo(shelf! DaE D E DcE DdE DeE DfE DgE DhE DiE D3E D(E DlE DmE DnE DoE DpE D'E DrE DsE DtE DuE D"E DwE DxE D)E DAE a aclocal addrFline agett) anacron apmd apropos apt ar arch arp as at atd at' atrm audiosend autoconf autoheader automa(e autoreconf autoscan autoupdate b ad loc(s anner asename ash atch c iff ison ootpd ootpgw ootptest Acmp Adiff e eFfsc( eFimage eFla el echo egrep e3ect el"tune emacs en" etags ex expand expr " false fdformat fdis( fetchmail fgconsole fgrep file find finger fingerd flex fmt fold formail free fsc( fsc(!minix ftp ftpd fuser l last last lastlog ld ldconfig ldd less less(e) lftp lftpget lin( ln load(e)s locale locate loc(file logger login logname logrotate loo( losetup lpc lpd lp' lpr lprm lpstat ls lsattr lsmod m m@ mail mail' mailstats p passwd paste patch pathch( perl pidof ping portmap poweroff pppd pr praliases printen" printf ps pwc( pwcon" pwd p)thon q 'uota ! raidstart ramsiAe ranli rarpd raw rcp rcs rdate rde" rdist rdistd readelf t tac tail tal( tal(d tar tcpd tcsh tee telinit telnet telnetd test tftp tftpd time tload top touch tr traceroute troff true tset tt) tuneFfs tunelp u ul umount uname uncompress unexpand unicode-start unicode-stop uni' unshar

Agrep AipF Aless Amore c cGG cGGfilt cal cardctl cardmgr cat cc cddaFwa" cdparanoia cdrdao cdrecord cfdis( chage chat chattr chec(pc chfn chgrp chmod chown chpasswd chroot chsh ch"t c(sum clear cmp col colcrt colrm column comm compress cp cpio cpp cron cronta csh

# gGG gaw( gcc gd get(e)codes gpm gprof grep groff groffer groupadd groupdel groupmod groups grpc( grpcon" gs gunAip gAexe gAip h halt hdparm head hexdump host hostid hostname htdigest hwcloc( i icon" id identd ifconfig ima(e imapd inetd info

mailto ma(e ma(ed m ma(emap man manpath mattri m ad loc(s mcat mcd mcop) mdel, mdeltree mdir mdu merge mesg metamail metasend mformat mimencode minfo m(dir m(dosfs m(eFfs m(fifo m(fs m(fs!extH m(fs!minix m(isofs m(lostGfound m(nod m(passwd m(raid m(swap m(temp mla el mmd mmount mmo"e modinfo modpro e more mount mountd mpartition mpgBFH

readlin( re oot rename renice reset resiAeFfs re" rexecd richtext rlogin rlogind rm rmail rmdir rmmod rootflags route routed rpcgen rpcinfo rpm rsh rshd runle"el run-parts rup ruptime rusers rusersd rwall rwho rwhod s scp screen script sdiff sed sendmail se' setfdprm set(e)codes setleds setmetamode

update uptime useradd userdel usermod users usleep uudecode uuencode uuidgen v "acation "dir "i "idmode "im "mstat "olname w w wall watch wc whatis whereis which who whoami whois write x xargs xinetd $ )acc )es )p ind )pcat

csplit ctags cut c"s d date dd dealloc"t de ugfs depmod de"dump df diff diffH dig dip dir dircolors dirname dmesg dnsdomainname dnssec-(e)gen dnssecma(e(e)set dnssec-sign(e) dnssec-signAone domainname dosfsc( du dumpeFfs dump(e)s

init insmod install ipchains ipchains-restore ipchains-sa"e ipcrm ipcs ipta les ipta les-restore ipta les-sa"e isodump isoinfo isosiAe iso"f) ispell % 3oin & ( d-mode ( drate (ernel"ersion (ill (illall (illallC (logd (s)ms

mpgHFB mrd mren mshowfat mt mtools mtoolstest mt)pe m" mAip n named namei nameif netstat newaliases newgrp newusers nfsd nfsstat nice nm nohup nsloo(up nsupdate o o 3cop) o 3dump od open"t

setsid setterm sftp sh shar show(e) showmount shred shutdown siAe s(ill slattach sleep snice sort split ssh ssh-add ssh-agent ssh-(e)gen ssh-(e)scan sshd stat statd strace strfile strings strip stt) su sudo sum swapoff swapon s)nc s)sctl s)s(logd s)slogd

)pchfn )pinit )pmatch )ppasswd )ppasswdd )ppoll )ppush )pser" )pset )ptest )pwhich )pxfr ' Acat Acmp Adiff Adump Aforce Agrep Aic Aless Amore Anew

(N)* + ,)N(* AN- .AR)ANT/


Additional information and help with 1.I8 6 Linux and "ariants

0()12 ,)N2/ (N)* A31s ,inux A31s -O/ vs. (nix (N)* commands (N)* Top 45 commands (N)* /ho!tcuts ,inux va!iants (N)* va!iants (N)* + ,inux 6isto!$ (N)* + ,inux tips (N)* + ,inux lin&s ,inux + (nix news ,inux 07A (N)* A31s 1nix which is not an acron)m was de"eloped ) some of the mem ers of the /ultics team at the ell la s starting in the late BIJK$s ) man) of the same people who help created the C programming language! &he 1.I8 toda) howe"er is the not 3ust the wor( of a couple of programmers! /an) other organiAations, institutes and "arious other indi"iduals contri uted significant additions to the s)stem we now (now to da)! See additional 1nix information and "ariants and information on the 1nix "ariants page! ,inux A31s 5e"eloped ) Linus &or"alds and further ela orated ) a num er of de"elopers throughout the world Linux 2lee%nuhks* or

-O/ ./. (N)* If )ou are a le to na"igate through /S-59S! Lou will e a le to pic( up on the na"igation of Linux and 1nix in the following chart we ha"e listed se"eral of the "arious similarities of 59S and 1nix! -O/ att!ib bac&up di! cls cop$ del delt!ee edit "o!mat (N)* chmod tar ls clear cp rm rm -: rmdir "i pico fdformat mount umount m" less MfileN cd chdir more file m(dir startx

)N-E* 1ate#o!$9
Software

1ompanies9
See .etwor(

Related Pa#es9
9perating S)stems

RE/O,.E%ere )ou a le to locate the answer to )our 'uestionsO Les .o

move + !ename t$pe cd mo!e 8 "ile md win

*li%nuks*,+not+*li,%nuhks- is a freel) a"aila le multitas(ing and multiuser operating s)stem! ,rom the outset, Linux was placed under <eneral ;u lic License 2<;L4! &he s)stem can e distri uted, used and expanded free of charge! In this wa), de"elopers ha"e access to all the source codes, thus eing a le to integrate new functions easil) or to find and eliminate programming ugs 'uic(l)! &here ) dri"ers for new adapters 2SCSI controller, graphics cards, etc!4 can e integrated "er) rapidl)! See additional Linux information and "ariants and information on the Linux "ariants page!

,)N(* + (N)* 1O

AN-/

= See our our complete o"er"iew page for a rief description on each of the elow commands!

A aFp P alias P ac P ar P arch P as P at P aw( 3 asename P ash P c P diff P fs P g P iff P rea( P s P )e cal P calendar P cancel P cat P cc P cd P chdir P chec(e' P chec(nr P chfn P chgrp P ch(e) P 1 chmod P chown P chsh P c(sum P clear P cls P cmp P col P comm P compress P continue P cop) P cp P cpio P cronta P csh P csplit P ctags P cu P cut - date P dc P df P deroff P diff P dircmp P dpost P du E echo P ed P edit P egrep P elm P emacs P ena le P en" P e'n P ex P exit P expand P expr : fc P fg P fgrep P file P find P finger P fmt P fold P for P foreach P ftp

G getfacl P gprof P grep P groupadd P groupdel P groupmod P gunAip P g"iew P g"im P gAip 6 halt P hash P hashstat P head P help P histor) P hostname ) id P ifconfig P isalist ; 3o s P 3oin 2 (e)login P (ill P (sh , ld P ldd P less P lex P ln P lo P locate P login P logname P logout P lp P lpadmin P lpc P lp' P lpr P lprm P lpstat P ls mach P mail P mailcompat P mailx P ma(e P man P mesg P m(dir P more P mount P mt P m" ne'n P netstat P newalias P newform P newgrp P nice P niscat P nischmod P nischown P N nischttl P nisdefaults P nisgrep P nismatch P nispasswd P nist ladm P nohup P nroff P nsloo(up O on P onintr P optisa P pac( P pagesiAe P passwd P paste P pax P pcat P perl P pg P pgrep P pico P ping P p(ill P poweroff P pr P priocntl P printf P ps P p"s P pwd 0 'uit R / T ( rcp P re oot P red P rehash P remsh P repeat P rg"iew P rg"im P rlogin P rm P rmail P rmdir P rn P rpcinfo P rsh P r"iew P r"im sFp P sag P sar P script P sdiff P sed P sendmail P set P seten" P setfacl P settime P sh P shutdown P sleep P sort P spell P split P stop P stt) P su P s)sinfo ta s P tail P tar P t l P tcop) P tee P telnet P time P timex P touch P tput P tr P traceroute P troff ul P umas( P unalias P unhash P uname P uncompress P uni' P unmount P unpac( P untar P until P useradd P userdel P usermod

. "acation P "edit P "grind P "i P "iew P "im W wait P wc P whereis P while P which P who P whois * 8 P xfd P xlsfonts P xset P xterm P xrd < )acc P )ppasswd

= Acat . &n addition to each of the abo/e explanations additional information about a specified command for your 0N&1 or #inux /ariant can be found by using the man command.

Some Useful Linux Commands


/teve Amble! :eb!ua!$ >55>

Contents
B Introduction F Shorthand at the Command ;rompt H &)pical 5ot ,iles @ 1seful ,iles C Important 5irectories J Important Bash Shell ?aria les Q Important 5aemons and Startup Ser"ices R %indow /anagers I Alpha etical List of ;rincipal Commands BK .otes on Applications BK!B /ail &ransfer Agents 2/&As4 BK!F /ail 1ser Agents 2/1As4 BK!H 7ditors BK!@ 9ther BB Some .ift) Slogans BF :eferences

1 Introduction
&his is m) own summar) of useful Linux a re"iations, directories, files, and commands! I use m) own annotations to recall useful options and arguments that are not necessaril) documented in eas)-to-find places! I 'uite often call up this file when I can$t remem er the s)ntax of a command that I use often 2 ut not often enough to remem er the s)ntaxS4! I also editorialiAe on the relati"e usefulness of different t)pes of programs!

&his document is wor( in progress! Send suggested changes and corrections to


ambler0ste"enVu5am0ca

9$:eill) has 3ust pu lished online an alpha etical list of commands from #inux in a Nutshell! It is a"aila le here! It contains more detailed explanations of man) of the commands listed here!

2 Shorthand at the Command Prompt


Some of these are specific to the ash shell! I ha"e not experimented enough with other shells to (now which are common to all shells! See also the ##Bash :eference Card$$, SSC 2FKKK4, a"aila le online!

6 - root director) !6 - current director) !6command-name - run a command in the current director) when the current director) is not on the path !!6 - parent director) W - home director) T - t)pical prompt when logged in as ordinar) user > - t)pical prompt when logged in as root or superuser S - repeat specified command SS - repeat pre"ious command XX - repeat pre"ious command with su stitution U - run a program in ac(ground mode >9ab?>9ab? - prints a list of all a"aila le commands! &his is 3ust an example of autocomplete with no restriction on the first letter! xD&a ED&a E - prints a list of all a"aila le completions for a command, where the eginning is ##x$$ >)lt?>Ctrl?>FD? - switch to the first "irtual text console >)lt?>Ctrl?>Fn? - switch to the nth "irtual text console! &)picall), there are six on a Linux ;C s)stem! >)lt?>Ctrl?>FI? - switch to the first <1I console, if there is one running! If the graphical console freeAes, one can switch to a nongraphical console, (ill the process that is gi"ing pro lems, and switch ac( to the graphical console using this shortcut! >)rrow:p? - scroll through the command histor) 2in ash4 >!hift?>Page:p? - scroll terminal output up! &his also wor(s at the login prompt, so )ou can scroll through )our oot messages! >!hift?>PageDown? - scroll terminal output down >Ctrl?>)lt?>S? - switch to next 8 ser"er resolution 2if the ser"er is set up for more than one resolution4 >Ctrl?>)lt?> ? - change to pre"ious 8 ser"er resolution >Ctrl?>)lt?>%k!pc? - (ill the current 8 ser"er! 1sed when normal exit is not possi le! >Ctrl?>)lt?>Del? - shut down the s)stem and re oot

- (ill the current process - logout from the current terminal - stop transfer to current terminal - resume transfer to current terminal! &his should e tried if the terminal stops responding! >Ctrl?1 - send current process to the ac(ground reset - restore a terminal to its default settings >.eftmousebutton? - Hold down left mouse utton and drag to highlight text! :eleasing the utton copies the region to the text uffer under 8 and 2if gpm is installed4 in console mode! >+iddlemousebutton? - Copies text from the text uffer and inserts it at the cursor location! %ith a two- utton mouse, clic( on oth uttons simultaneousl)! It is necessar) for three- utton emulation to e ena led, either under gpm or in 8,RJConfig!
>Ctrl?c >Ctrl?d >Ctrl?s >Ctrl?5

3 Typical Dot iles


&here is some redundanc) across these programs! ,or example, the loo( and eha"ior of emacs can e customiAed ) usinng the !emacs file, ut also ) adding the appropriate modifications to the !8defaults file! 5efault "ersions of these files are often installed in users$ home directories when the software pac(ages that use them are installed! If a program doesn$t find its configuration file in the user$s home director), it will often fall ac( on a s)tem-wide default configuration file installed in one of the su directories that the pac(age li"es in!

! ash-logout - file executed ) ash shell on logout ! ash-profile - initialiAation of ash shell run onl) on login! Bash loo(s first for a ! ash-profile file when started as a login shell or with the -login option! If it does not find ! ash-profile, it loo(s for ! ash-login! If it doesn$t find that, it loo(s for !profile! S)stem-wide functions and aliases go in 6etc6 ashrc and default en"ironment "aria les go in 6etc6profile! ! ashrc - initialiAation command run when ash shell starts up as a non-login shell !cshrc - initialiAation commands that are run automaticall) 2li(e autoexec! at4 when C shell is initiated !emacs - configuration file for emacs editor !f"wmrc - configuration file for f"wm window manager !f"wmFrc - configuration file for f"wmF window manager !3edrc - configuration file for the 3ed text editor !lessrc - t)picall) contains (e) indings for cursor mo"ement with the less command !login - initialiAation file when user logs in !logout - commands run when user logs out !wm-st)le - gi"es choice of default window manager if one is not specified in startx !8defaults - sets up 8 resources for indi"idual user! &he eha"ior of man) different application programs can e changed ) modif)ing this file!

!xinitrc - initialiAation file when running startx! Can e used to acti"ate applications, run a gi"en window manager, and modif) the appearance of the root window! !xsession - configuration file for xdm

! "seful iles

6 oot6"mlinuA - the t)pical location and name of the Linux (ernel! In the Slac(ware distri ution, the (ernel is located at 6"mlinuA! 6de"6fdK - first flopp) dis( dri"e 6de"6fdKHB@@K - dri"er for the first flopp) dri"e in high densit) mode! <enerall), this is in"o(ed when formatting a flopp) dri"e for a particular densit)! Slac(ware comes with dri"ers that allow for formatting a H!C+ dis(ette with up to B!Q/B of space! :ed Hat and /andra(e do not contain these de"ice dri"er files ) default! 6de"6fdB - second flopp) dis( dri"e 6de"6hda - first I57 hard dri"e 6de"6hdc - on man) machines, the I57 cdrom dri"e! /ost often, there is a s)m olic lin( called 6de"6cdrom which is 3ust a lin( to the true cdrom dri"er file! 6de"6null - used when )ou want to send output into o li"ion 6etc6aliases - file containing aliases used ) sendmail and other /&As 2mail transport agents4! After updating this file, it is necessar) to run the newaliases utilit) for the changes to e passed to sendmail! 6etc6 ashrc - s)stem-wide default functions and aliases for the ash shell 6etc6conf!modules - aliases and options for configura le modules 6etc6cronta - shell script to run different commands periodicall) 2hourl), dail), wee(l), monthl), etc!4 6etc65I:-C9L9:S - used to store colors for different file t)pes when using ls command! &he dircolors command uses this file when there is not a !dir-colors file in the user$s home director)! 1sed in con3unction with the e"al command 2see elow4! 6etc6exports - specifies hosts to which file s)stems can e exported using .,S! /an exports contains information on how to set up this file for remote users! 6etc6fsta - contains information on partitions and files)stems used ) s)stem to mount different partitions and de"ices on the director) tree 6etc6H9S&.A/7 - stores the name of the host computer 6etc6hosts - contains a list of host names and a solute I; addresses! 6etc6hosts!allow - hosts allowed 2 ) the tcpd daemon4 to access Internet ser"ices 6etc6hosts!den) - hosts for idden 2 ) the tcpd daemon4 to access Internet ser"ices 6etc6group - similar to 6etc6passwd ut for groups 6etc6inetd!conf - configures the inetd daemon to tell it what &C;6I; ser"ices to pro"ide 2which daemons to load at oot time4! A good start to securing a Linux ox is to turn off these ser"ices unless the) are necessar)! 6etc6initta - runs different programs and processes on startup! &his is t)picall) the program which is responsi le for, among other things, setting the default runle"el, running the rc!s)sinit script contained in 6etc6rc!d, setting up "irtual login terminals, ringing down the s)stem in an orderl) fashion in response to >Ctrl?

>)lt?>Del?,

running the rc script in 6etc6rc!d, and running xdm for a graphical login prompt 2onl) if the default runle"el is set for a graphical login4! 6etc6issue - pre-login message! &his is often o"erwitten ) the 6etc6rc!d6rc!S script 2in Slac(ware4 or ) the 6etc6rc!d6rc!local script 2in /andra(e and :ed Hat, and perhaps other rpm- ased distri utions4! &he rele"ant lines should e commented out 2or changed4 in these scripts if a custom pre-login message is desired! 6etc6lilo!conf - configuration file for lilo oot loader 6etc6motd - message of the da) file, printed immediatel) after login! &his is often o"erwritten ) 6etc6rc!d6rc!S 2Slac(ware4 or 6etc6rc!d6rc!local 2/andra(e6:ed Hat4 on startup! See the remar(s in connection with 6etc6issue! 6etc6mta - shows currentl) mounted de"ices and partitions and their status 6etc6passwd - contains passwords and other information concerning users who are registered to use the s)stem! ,or o "ious securit) reasons, this is reada le onl) ) root! It can e modified ) root directl), ut it is prefera le to use a configuration utilit) such as passwd to ma(e the changes! A corrupt 6etc6passwd file can easil) render a Linux ox unusa le! 6etc6printcap - shows the setup of printers 6etc6profile - sets s)stem-wide defaults for ash shell! It is this file in Slac(ware that sets up the 5I:-C9L9:S en"ironment "aria le for the color ls command! Also sets up other s)stem-wide en"ironment "aria les! 6etc6resol"!conf - contains a list of domain name ser"ers used ) the local machine 6etc6securett) - contains a list of terminals on which root can login! ,or securit) reasons, this should not include dialup terminals! 6etc6termcap - ASCII data ase defining the capa ilities and characteristics of different consoles, terminals, and printers 6etc68BB68,RJConfig - 8 configuration file! &he location in Slac(ware is 6etc68,RJConfig! 6proc6cpuinfo - cpu information 6proc6files)stems - prints files)stems currentl) in use 6proc6interrupts - prints interrupts currentl) in use 6proc6ioports - contains a list of the i6o addresses used ) "arious de"ices connected to the computer 6proc6(core - &he command ls -l 6proc6(core will gi"e the amount of :A/ on the computer! It$s also possi le to use the free command to get the same information 2and more4! 6proc6"ersion - prints Linux "ersion and other info 6"ar6log6messages - used ) s)slog daemon to store (ernel oot-time messages 6"ar6log6lastlog - used ) s)stem to store information a out last oot 6"ar6log6wtmp - contains inar) data indicating login times and duration for each user on s)stem

# Important Directories
5ifferent distri utions ha"e different director) structures, despite attempts at standardiAation such as the the Linux ,iles)stem Hierarch) Standard 2,HS4 organiAation!

6 in - essential 1.I8 commands such as ls, etc! Should contain all inaries needed to oot the s)stem or run it in single-user mode 6 oot - files used during ooting and possi l) the (ernel itself are stored here 6de" - contains de"ice files for "arious de"ices on s)stem 6etc - files used ) su s)stems such as networ(ing, .,S, and mail! Includes ta les of dis(s to mount, processes to run on startup, etc! 6etc6profile!d - contains scripts that are run ) 6etc6profile upon login! 6etc6rc!d - contains a num er of shell scripts that are run on ootup at different run le"els! &here is also t)picall) an rc!inetB script to set up networ(ing 2in Slac(war4, an rc!modules script to load modular de"ice dri"ers, and an rc!local script that can e edited to run commands desired ) the administrator, along the lines of autoexec! at in 59S! 6etc6rc!d6init!d - contains most of the initialiAation scripts themsel"es on an rpmased s)stem! 6etc6rc!d6rc=!d - where ##=$$ is a num er corresponding to the default run le"el! Contains files for ser"ices to e started and stopped at that run le"el! 9n rpmased s)stems, these files are s)m olic lin(s to the initialiAation scripts themsel"es, which are in 6etc6rc!d6init!d! 6etc6s(el - director) containing se"eral example or s(eleton initialiAation shells! 9ften contains su directories and files used to populate a new user$s home director)! 6etc68BB - configuration files for the 8 %indow s)stem 6home - home directories of indi"idual users 6li - standard shared li rar) files 6li 6modules - modular de"ice dri"er files, most with !o extensions 6mnt - t)pical mount point for man) user-mounta le de"ices such as flopp) dri"es, cd-rom readers, etc! 7ach de"ice is mounted on a su director) of 6mnt! 6proc - "irtual file s)stem that pro"ides a num er of s)stem statistics 6root - home director) for root 6s in - location of inaries used for s)stem administration, configuration, and monitoring 6tmp - director) specificall) designed for programs and users to store temporar) files! 6usr - director) containing a num er of su director) with programs, li raries, documentation, etc! 6usr6 in - contains most user commands! Should not contain inaries necessar) for ooting the s)stem, which go in 6 in! &he 6 in director) is generall) located on the same dis( partition as 6, which is mounted in read-onl) mode during the oot process! 9ther files)stems are onl) mounted at a later stage during startup, so putting inaries essential for oot here is not a good idea! 6usr6 in68BB - most often a s)m olic lin( to 6usr68BB:J6 in, which contains executa le inaries related to the 8 %indow s)stem 6usr6doc - location of miscellaneous documentation, and the main location of program documentation files under Slac(ware 6usr6include - standard location of include files used in C programs such as stdio!h 6usr6info - primar) location of the <.1 info s)stem files

6usr6li - standard li rar) files such as li c!a! Searched ) the lin(er when programs are compiled! 6usr6li 68BB - 8 %indow s)stem distri ution 6usr6local6 in - )et another place to loo( for comon executa les 6usr6man - location of manual page files 6usr6s in - other commands used ) superuser for s)stem administration 6usr6share - contains su directories where man) installed programs ha"e configuration, setup and auxiliar) files 6usr6share6doc - location of program documentation files under /andra(e and :ed Hat 6usr6src - location of source programs used to uild s)stem! Source code for programs of all t)pes are often unpac(ed in this director)! 6usr6src6linux - often a s)m olic lin( to a su director) whose name corresponds to the exact "ersion of the Linux (ernel that is running! Contains the (ernel sources! 6"ar - administrati"e files such as log files, used ) "arious utilities 6"ar6log6pac(ages - contains files, each of which has detailed information on an installed pac(age in Slac(ware! &he same file can also e found at 6"ar6adm6pac(ages, since the adm su director) is a s)m olic lin( to log! 7ach pac(age file contains a short description plus a list of all installed files! 6"ar6log6scripts - pac(age installation scripts in Slac(ware are stored here! Lou can inspect these scripts to see what special features are included in indi"idual pac(ages! 6"ar6spool - temporar) storage for files eing printed, mail that has not )et een pic(ed up, etc!

$ Important %ash Shell &ariables


&hese "aria les are most often inherited or declared when a shell is started! A great reference for ash shell "aria le, ash uiltin commands, and ash in general is SSC 2FKKK4!

H9/7 - home director), a re"iated as W /AIL - name of file that mail is stored in 2mailbox4 /AILCH7CV - sets the fre'uenc) at which ash chec(s for mail ;A&H - director) paths to search for executa le files! According to ! 2ractical 3uide to #inux, p!HFI, the ;A&H is set in 6etc6profile! 9n m) Linux ox, 6etc6profile adds 6usr68BB:J6 in to the path, which means that the path must e set efore ) another configuration file! &he ! ash-profile file in m) home director) adds 6home6am ler6 in to the path! 9n m) Linux ox, the first command to set the path would seem to e in 6etc6rc!d6rc!s)sinit, which is one of the shell scripts in"o(ed ) the init process 2initta 4! &hen, 6etc6profile adds 6usr68BB:J6 in! ,inall), ! ash-profile adds 6home6am ler6 in! ;SB - prompt string! &hings that can e put in the prompt string include Yh 2hostname4, Yu 2username4, Yw 2a solute pathname of wor(ing director)4, Y% 2name of wor(ing director) w6o path4, Yd 2date4, Yt 2time4! See p!HHB of ! 2ractical 3uide to #inux for more details! 9n m) :ed Hat oxes, the primar)

prompt string is set in the 6etc6 ashrc file! &he prompt is also set in 6etc6profile, ut the setting in ashrc seems to ta(e precedence! I also ha"e a ! ashrc file, which in turn runs 6etc6 ashrc, which sets the prompt! &his means that the same prompt is used ) xterm and rx"t in 8 sessions! 9n m) Slac(ware ox, the command line prompt is set in 6etc6profile! &he xterm and rx"t prompts are different, since I don$t ha"e a ! ash-profile file which is run when an xterm is started! In fact, I don$t (now where the prompt is set in 8 sessions! It is not set ) 6usr68BB:J6li 68BB6app-defaults68&erm! ;SF - secondar) prompt string!

' Important Daemons and Startup Ser(ices


&hese are programs or processes which are run at oot time! Some remain in memor) to execute "arious tas(s when re'uired 2daemons4! /ost are started and stopped with scripts in the 6etc6rc!d6init!d director) 2see a o"e4! &he exact contents of this director) will depend on which pac(ages from a particular distri ution are installed! ,or example, installing the Apache pac(age will cause an httpd script to e placed in 6etc6rc!d6init!d! &here are man pages on most of these! &he :ed Hat program t(s)s" 2nts)s" is the non graphical "ersion4 allows root to automaticall) configure which of these are started automaticall) at oot time! &he linuxconf program does the same thing, although I ha"en$t tried it! &he utilit) ch(config is also designed to 'uer) and configure runtime ser"ices for different runle"els! &he www0mandrakeuser0org site has a good page on common ser"ices6daemons, especiall) those included in recent "ersions of the /andra(e distri ution! A good source of information on daemons and ser"ices is the ##Linux 5e"ices, 5aemons, Ser"ices$$ chapter of the C&5; 2FKKKa4 document!

amd - runs the automount daemon for remote files)stem mounting such as nfs anacron - chec(s dela)ed #cron$ tas(s 2see elow4 at oot time and executes them! 1seful if )ou ha"e cron 3o s scheduled ut don$t run )our machine all the time! apmd - Ad"anced ;ower /anagement BI9S daemon! ,or use on machines, especiall) laptops, that support apm! /onitors atter) status and can shut down the s)stem if power is too low! arpwatch - (eeps watch for ethernet I; address pairings that are resol"ed using the A:; protocol! atd - runs 3o s 'ueued ) #at$ autofs - control the operation of automount daemons, used to mount and unmount de"ices on demand ootparamd - allows computers to oot from a Linux machine using the B99&; networ( protocol! A ser"er process that pro"ides information to dis(less clients necessar) for ooting crond - automatic tas( scheduler! /anages the execution of tas(s that are executed at regular ut infre'uent inter"als, such as rotating log files, cleaning up 6tmp directories, etc!

cups - daemon for print ser"ices under the Common 1nix ;rinter S)stem, a replacement for lpd dhcpd - implements the 5)namic Host Configuration ;rotocol 25HC;4 and the Internet Bootstrap ;rotocol 2B99&;4! 1sed to lease out I; addresses to remote machines! dra(font - font ser"er in /andra(e fetchmail - daemon to fetch mail at regular inter"als from mail ser"ers ftpd - ftp ser"er daemon gated - routing daemon that handles multiple routing protocols and replaces routed and egpup gpm - useful mouse ser"er for applications running on the Linux console! httpd - the Apache we ser"er h)pertext transfer protocol daemon identd - &he identd ser"er pro"ides a means to determine the identit) of a user of a particular &C; connection! <i"en a &C; port num er pair, it returns a character string which identifies the owner of that connection on the ser"er$s s)stem! inetd - listens for ser"ice re'uests on networ( connections, particularl) dial-in ser"ices! &his daemon can automaticall) load and unload other daemons 2ftpd, telnetd, etc!4, there ) economiAing on s)stem resources! In the latest "ersion of :ed Hat 2Q!K at the time of writing4, it has een replaced ) xinetd! A partial list of ser"ices controlled ) inetd is listed elow! 1nder man) distri utions, inetd will execute scripts in the file 6etc6inetd!conf! innd - 1senet news ser"er daemon ipchains - daemon for pac(et forwarding! 1sed for configuring a gatewa)6firewall! isdn pro"ides IS5. networ( interfacing ser"ices isdn@linux - for users of IS5. cards (erneld - automaticall) loads and unloads (ernel modules (e)ta le - loads the appropriate (e) oard map from 6etc6s)sconfig6 (e) oard (header (udAu - detects and configures new or changed hardware during oot linuxconf - ##startup hoo($$ needed for the linuxconf s)stem configuration tool lpd - line printer and print spooler daemon mcser" - ser"er program for the /idnight Commander networ(ing file s)stem! It pro"ides access to the host file s)stem to clients running the /idnight file s)stem 2currentl), onl) the /idnight Commander file manager4! If the program is run as root the program will tr) to get a reser"ed port otherwise it will use IRQJ as the port! If the s)stem has a portmapper running, then the port will e registered with the portmapper and thus clients will automaticall) connect to the right port! If the s)stem does not ha"e a portmapper, then a port should e manuall) specified with the -p option 2see elow4! m)s'l - data ase ser"er daemon named - pro"ides 5.S ser"ices netfs - networ( files)stem mounter! 1sed for mounting nfs, sm and ncp shares on oot! networ( -acti"ates all networ( interfaces at oot time ) calling scripts in 6etc6s)sconfig6networ(-scripts

nfsd - used for exporting nfs shares when re'uested ) remote s)stems nfsloc( - starts and stops nfs file loc(ing ser"ice numloc( - loc(s numloc( (e) at init runle"el change pcmcia - generic ser"ices for pcmcia cards in laptops portmap - needed for :emote ;rocedure Calls postfix - mail transport agent which is a replacement for sendmail! .ow the default on des(top installations of /andra(e! postgres'l - data ase ser"er daemon random - random num er generating daemon, related to securit) and encr)ption routed - manages routing ta les rstatd - (ernel statistics ser"er! Allows users on a networ( to get performance statistics for an) connected machine! rusersd - pro"ides ser"ices that allow users to find one another o"er the networ( rwalld - allows users to use rwall to write messages on remote terminals rwhod - ser"er which maintains the data ase used ) the rwho2B4 and ruptime2B4 programs! Its operation is predicated on the a ilit) to roadcast messages on a networ(! sendmail - mail transfer agent! &his is the agent that comes with :ed Hat! 9thers, such as smtpd, are not included! sm - needed for running SA/BA snmpd - pro"ides Simple .etwor( /anagement ;rotocol support sound - daemon for managing sound s'uid - we page prox) ser"er daemon s)slogd - manages s)stem log files smtpd - Simple /ail &ransfer ;rotocol, designed for the exchange of electronic mail messages! Se"eral daemons that support S/&; are a"aila le, including sendmail, smtpd, rsmtpd, 'mail, Amail, etc! tcpd - from the tcp-wrappers pac(age! Intercepts re'uests normall) handled ) inetd and filters them through the files hosts!allow and hosts!den) files, which can restrict access to ser"ices ased on t)pe of ser"ice, origin of re'uest, destination, etc! :e'uests are intercepted ecause calls to particular ser"ices are replaced with calls to tcpd in 6etc6inetd!conf! telnetd - telnet ser"er daemon us - daemon for de"ices on 1ni"ersal Serial Bus xfs - 8 font ser"er xinetd - more modern replacement for inetd! It apparentl) allows for similar (inds of access filters to the ones used ) tcpd in con3unction with inetd! xinetd replaces inetd as the default networ( ser"ices daemon in :ed Hat Q!K! xntpd - .etwor( &ime ;rotocol daemon! ;ro"ides a means to s)ncroniAe time o"er the networ(! we min - daemon for we min we - ased s)stem administration program )p ind - .IS inder! .eeded if computer is part of .etwor( Information Ser"ice domain!

) *indo+ ,ana-ers
&he ##%indow /anagers for 8$$ site is extremel) useful for (eeping trac( of new Linux window managers! See httpJ--winman0org!

Afterstep - Based on ,"wm! 5esigned to gi"e a similar loo( and feel to the .extStep interface! AnotherLe"el - a custom configuration for f"wmF which mimics the loo( and feel of %indowsIC! Blac( ox - a light, fast, window manager! It doesn$t clutter the screen with too much 3un(, ut it gets the 3o done efficientl)! C57 - Common 5es(top 7n"ironment! &his is the default window manager on man) commercial 1nix s)stems! &here is no free "ersion! 7nlightenment - ?er) configura le, and pro a l) the coolest loo(ing window manager, ut a it of a resource hog! ,lwm - ,ast, Light %indow /anager! It has "er) few features, ut is "er) small! ,"wm - , 2O4 ?irtual %indow /anager! &his, along with ,"wmF, are old stand ies in the Linux world! &he) are 'uite configura le, ut configuration in"ol"es editing text files which are sometimes o scure! ,"wmF - newer "ersion of a o"e! ,"wmIC - implementation of ,"wmF configured to loo( and feel li(e %indows IC! <nome - <nome des(top en"ironment! A thema le collection of des(top utilities that can e used with different window managers! &he current default window manager for a gnome session is Sawfish! Icewm - Ice %indow /anager! ?er) small, "er) fast, 'uite configura le! 9n low memor)6small hard dri"e machines, this one is m) fa"orite! Configuration in"ol"es editing text files, ut the s)ntax is extremel) eas) to understand! &here are also a couple of third-part) programs a"aila le which allow the user to configure Icewm using a graphical interface! V57 - V 5es(top 7n"ironment! /an) of the des(top utilities can e run under different window managers! I ma) e wrong, ut I elie"e (i( d is the onl) program out there that allows the user to reconfigure the (e) oard la)out to different national (e) oards on the fl), with one-clic( switching from one to the other! 1nfortunatel), this utilit) is no longer a"aila le under V57 F!x! Vwm - the window manager that comes with the V57 des(top en"ironment! /wm - /otif window manager! 9lwm - 9pen Loo( window manager! Sawfish - a small, efficient, configura le window manager that is now the default window manager with <nome! &wm - &a window manager! 157 - 1nix 5es(top 7n"ironment! In earl) de"elopment stages! An attempt to create a new t)pe of des(top en"ironment for 1nix machines, including Linux! %indowma(er - 9ne of the more popular window managers! Highl) configura le and thema le!

8,ce - ##Cholesterol-,ree 5es(top 7n"ironment$$! Includes its own window manager, a tool ar, a sound manager, a ac(ground manager, and a file manager! It has tearoff menus, up to twel"e "irtual des(tops, etc! It is completel) configura le with menus! Its tool ar loo(s li(e the one in C57! I find it eas) to use and to configure, and eas) on s)stem resources!

. Alphabetical List of Principal Commands


In the following command list, the distinction etween upper case and lower case letters is important! /ost of the commands are utilities that are run ) in"o(ing their own executa le files! In some cases, the) are commands which are internal to a shell such as ash 2shell uiltins4! &he shell uiltins are indicated! &here are now man) utilities that are included with either the <nome or the V57 des(top en"ironments, so man) that it would e difficult to include them all here! In man) cases, the) duplicate the functionalit) of one or more of the programs listed elow! I would suggest consulting the online documentation for these pac(ages! Another good source of information on commands is the C&5; 2FKKK 4 document! &here are different chapters which group commands in different categories! 9n rpm- ased s)stems, to find out which pac(age owns the command foo 2where foo is a standalone executa le4, use the command rpm 5 f foo!

aFp - translation utilit) from aw( to ;erl aFps - translation utilit) from ##an)$$ to ;ostscript ac - print statistics concerning user connect time access - determine whether a file can e accessed acroread - Ado e utilit) for "iewing pdf files adduser - used ) root to add user to s)stem o usage0 adduser userid afio - utilit) to cop) or restore files to an archi"e file! &his utilit) is not part of the asic internal and external programs under :ed Hat Linux! It is a"aila le as an rpm on the rpmfind!net site! agett) - ena les login on terminals! See gett), mgett), and uugett)! ali - list mail aliases alias - assign name to specified command list! &his is actuall) a shell uiltin! 9n m) :ed Hat s)stem, I ha"e glo al alias commands in m) 6etc6 ashrc file and in m) 6! ashrc file! 9n m) Slac(ware ox, I ha"e made the rm command a little it safer with o alias rm*$rm -i$ so that )ou can$t recursi"el) delete )our 6de" director) without telling the s)stem )ou$re sure )ou want to do it!

alien - utilit) to con"ert to and from different Linux pac(age formats! Can handle 5e ian 2de 4, Stampede 2stp4, :ed Hat 2rpm4 and Slac(ware 2tgA4 pac(ages!

apropos - displa) command names ased on (e)word search o usage0 apropos keyword apsfilter - printer filter called ) lpd to deal with printing different t)pes of files! &his is a fairl) sophisticated print filter! It is not set up ) default in Slac(ware! It used to e a"aila le on the second cd of a Slac(ware distri ution! Since @!K, it is a"aila le as one of the main pac(ages in the ap set! :ead the mail that the installation program sends to the root user! I elie"e that :ed Hat uses its own printer filters! ar - create, modif) and extract from archi"es arch - print machine architecture t)pe as - the porta le <.1 assem ler asapm - AfterStep laptop ad"anced power management utilit) ash - a shell, a "er) simple shell program sometimes used on oot dis(ettes since it ta(es up much less space than ash, tcsh, Ash, etc! asload - AfterStep cpu load monitor asmail - AfterStep mail chec(ing utilit) asmodem - AfterStep utilit) to monitor modem status aspell - a spell chec(ing program along the lines of ispell aspostit - 8 %indow postit note utilit) at - executes a shell script at specified time! 1se at' to show pending 3o s, and atrm to remo"e 3o s from the 'ueue! o usage0 at time o or0 at -f file time at' - shows pending 3o s 'ueued ) at! If run ) root, shows e"er) od)$s pending 3o s! atrm - remo"es pending 3o s 'ueued ) at! 1se at' to determine the identities of "arious 3o s! o usage0 atrm 4ob aw( - searches for and process patterns in a file anner - print anner to standard output! S)ntax is o anner DoptionE DcharactersE ash - Bourne again shell! &his is the default shell in the :ed Hat installation! atch - 'ueue, examine, or delete 3o s for later execution! See at! c - a language 2compiler4 similar to C, with unlimited precision arithmetic g ;I5 - send process with pid ##;I5$$ to the ac(ground! &his is the same as executing >Ctrl?1 while interacting with the running process! &his is a shell uiltin! h - puts a 3o in the ac(ground! &his is a shell uiltin! iff - mail notification utilit)! .otifies user of mail arri"al and sender$s name! ind - displa)s or redefines (e) indings! &his is a shell uiltin! ison - parser generator similar to )acc ru - a powerful ac(up utilit) program! Commercial! 5emonstration "ersions are often included with Linux distri utions such as :ed Hat! sh - e'ui"alent to ash unAipF - used to uncompress files compressed with AipF )acc - parser generator

AipF - compresses with algorithm different from gAip Aless - "iew Aipped files cGG - in"o(es <.1 C and CGG compiler cal - displa)s a BF-month calendar for the gi"en )ear or a one-month calendar of the gi"en month o usage0 cal month year cat - com ine, cop) standard input to standard output! 1sed to 3oin or displa) files! cd - change wor(ing director)! &his is a shell uiltin in ash, tcsh and Ash! cdpla) - command line utilit) for pla)ing audio cds cfdis( - similar to fdis(, ut menu-dri"en chat - used to interact with a modem "ia a chat script chgrp - changes group associated with file! Can e used to change the group associated with su directories and files of a director)! o usage0 chgrp group files o or0 chgrp -: group files ch(config - Wuer) or update s)stem ser"ices6daemons for different runle"els! /anipulates the "arious s)m olic lin(s in 6etc6rc!d! &his utilit) is included with man) rpm- ased distri utions such as :edHat and /andra(e! It is designed to wor( with S)stem ? initialiAation scripts! <raphical tools for configuring s)stem ser"ices include nts)s", t(s)s" and (s)s" 2the latter is a V57 utilit)4! chmod - set permissions 2modes4 of files or directories! A "alue of @ is used for read permission! A "alue of F is used for write permission! A "alue of B is used for execute permission! See umas( for default file permissions upon file creation! Chmod can also e used to change the suid it on files! &he s)ntax for the s)m olic "ersion is o chmod DoptionsE who operation permission file-list &he s)ntax for the a solute "ersion is
o

chmod DoptionsE mode file-list

&o set the uid to the owner$s permissions, use


o

chmod u Gs file-name

&o set the uid to the group$s permissions, use


o

chmod g Gs file-name

&here are lots of securit) issues related to allowing a program to ha"e root$s permissions when run ) an ordinar) user! I don$t pretend to understand all of these issues!

chown - changes ownership of a file! Can e used recursi"el)! o usage0 chown userid files

or0 chown -: userid files chsh - change default shell ci - creates or records changes in an :CS file clear - clear screen command cmp - compares two files for differences o usage0 cmp file5 file6 co - retrie"es an unencoded "ersion of an :CS file comm - compares sorted files configure - automaticall) configures software source code color-xterm - color xterm program! 1nder :ed Hat, this is 3ust a lin( to xtermcolor! control-panel - graphical s)stem configuration tool under :ed Hat! cp - copies on or more files! :ecursi"e cop)ing is one simple wa) of archi"ing part of a director) structure! 1se the command as follows0 o cp -r 6sourcedirector) 6targetdirector) cpio - direct cop) of files to an output de"ice! Allows creation of archi"e file spanning multiple dis(ettes! Allows one director) structure to e mirrored elsewhere on the partition or on another partition! In order to ac( up an entire director) structure on dis(ettes, cd to the director) and use the following command0 o find ! -depth -print | cpio -o" N 6de"6fdK
o

&o restore from dis(ettes, use0


o

cpio -i" M 6de"6fdK

&he cpio command will prompt the user to insert more dis(ettes as the) are needed! &he command for mirroring a director) structure is the following0
o

find ! -depth -print | cpio -p" 6destinationdirector)

&his copies the wor(ing director) and its contents, including su directories, into 6destinationdirector)! In order to cop) an indi"idual file which is larger than a flopp), use0 find ! -name nameoffile -print | cpio -i" N 6de"6fdK cp(gtool - Slac(ware tool to install, uninstall and 'uer) pac(ages! ,ront end to installp(g, remo"ep(g, ma(ep(g! &his is the graphical "ersion that uses ncurses! cpp - <.1 C-compati le compiler preprocessor cronta - schedules command to run at regularl) specified time csh - run C shell csplit - separate files into sections! See also split! c"s - manages concurrent acces to files in a hierarch)! Stands for concurrent "ersion s)stem! Is uilt on :CS! It stores successi"e re"isions of files efficientl)
o

and ensures that access to files ) multiple de"elopers is done in a controlled manner! 1seful when man) de"elopers are wor(ing on the same pro3ect! cut - selects characters or &AB-separated fields from lines of input and writes them to standard output date - displa)s or sets date and time o usage0 date o or0 date date dd - direct cop) of file from one de"ice to another! Can e used to ma(e copies of oot or root dis(ettes for installing Linux! It can e used, for example, to ma(e and exact cop) of a flopp) dis(, as follows! ,irst, place the dis(ette to e copied in the flopp) dri"e! &hen, o dd if*6de"6fdK i s*CBF N flopp)!cop) o :eplace the dis(ette with a fresh dis(ette! o dd if*flopp)!cop) s*CBF of*6de"6fdK &he i s and s options specif) the loc( siAes for input and for oth input and output! A oot dis( image can e directl) copied to a flopp) using the second of the two dd commands a o"e!

declare - declares attri utes for a "aria le 2same as t)peset4! &his is a shell uiltin! df - displa)s capacit) and free capacit) on different ph)sical de"ices such as hard dri"e partitions and flopp) dri"es that are mounted on the file s)stem! <i"es free space in loc(s! %ith the 2undocumented4 option -h, the program gi"es free space in / or < ! &his is useful for those accustomed to thin(ing of the capacit) of a high-densit) H!C inch dis(ette as B@@K(! diff - displa)s differences etween two files o usage0 diff file5 file6 diffH - compares three files and reports on differences dip - used to set up a SLI; or ;;; connection! It can e used to set up an outgoing SLI; connection or an incoming connection! diplogin - used for setting up incoming dip connections! See the man page for dip! dir - a "ariation of the <.1 ls command that defaults to printing file names in columns dircolors - set colors for <.1 ls command! In Slac(ware, this command is run ) the 6etc6profile script! &hen, whene"er xterm is run with the -ls 2login shell4 option, ls displa)s different colors for different t)pes of files! &)pical usage is e"al #dircolors - #! In :ed Hat and /andra(e, I get color directories ) aliasing the ls command 2see elow4! displa) - set displa) for output of programms under 8 %indows! Can e used to run a program on a remote machine while displa)ing the output on a local machine! &he remote machine must ha"e permission to send output to the local machine! &his is actuall) an en"ironment "aria le! See the more detailed discussion in connection with the xhost command elow! dmesg - displa)s messages from 6"ar6log relati"e to the most recent oot dos - in"o(e the 59S7/1 59S emulator du - displa)s information on dis( usage! &he command

du 6 - h P less

will displa) detailed dis( usage for each su director) starting at root, gi"ing files siAes in )tes!

dump(e)s - print information a out the (e) oard dri"er$s translation ta les to standard output d"il3 - send a d"i file to a Laser3et printer! &here are specialiAed "ersions for indi"idual models of Laser3et printer! d"il3Fp - specialiAed "ersion of d"il3 for the IIp series of printers! See a o"e! d"ips - send a d"i file to a ;ostscript printer, to a ;ostscript capa le Laser3et printer, or to a file 2with the -o option4! &here is a switch to print onl) a su set of the pages, and another switch to print in landscape mode! 1se -t landscape, which is one of the arguments to the paper t)pe switch! If )ou ha"e one page of a document that is a wide ta le, and )ou wish to print this in landscape mode, use o d"ips filename -pp pagenumber -t landscape eFfsc( - chec( an extF files)stem! &he s)ntax is o eFfsc( *de/*de/icename where the files)stem is on 6de"6de"icename! &he de"ice should not e mounted, and this program must e run as root!

echo - write arguments to standard output! 9ne use is to print out information a out en"ironment "aria les, as in o echo T;A&H - list paths to search o echo TH9/7 or echo W - list name of home director) &his is a shell uiltin!

editres - a d)namic resource editor for 8 &ool(it applications! Allows the user to change 8 resources for indi"idual applications! efax - fax program efix - con"ert etween fax, text, it-map and gra)-scale formats egrep - search files for lines that match regular expressions! :uns faster than grep and fgrep! elm - an interacti"e mail s)stem el"is - a "ersion of the "i text editor emacs - screen oriented text editor en" - despla) the current en"ironment or set a "aria le e'ual to a new "alue e"al - scans and e"aluates the command line! See dircolors command! &his is a shell uiltin! ex - interacti"e command- ased editor! &he man page lists it as eing the same as "im, an impro"ed "ersion of "i! exec - s)stem call which creates a su shell to execute a inar) or a script! &his is a shell uiltin! exec"e - a "ariation of the exec command!

exit - exit a shell! &his is a shell uiltin! expand - con"ert ta s in files to spaces and write to standard output expect - a program that ##tal(s$$ to other interacti"e programs according to a script! ,ollowing the script, 7xpect (nows what can e expected from a program and what the correct response should e! An interpreted language pro"ides ranching and high-le"el control structures to direct the dialogue! In addition, the user can ta(e control and interact directl) when desired, afterward returning control to the script! export - place the "alue of a "aria le in the calling en"ironment 2ma(es it glo al4! &his is a shell uiltin! expr - utilit) e"aluates an expression and displa)s the result fFc - ,9:&:A. to C translator fQQ - ,9:&:A. QQ compiler false - null command that returns an unsuccessful exit status fax - simple user interface to efax and efix programs fc - "iews, edits, and executes commands for the histor) list! &his is a shell uiltin! fdformat - low le"el format of a flopp) de"ice fetchmail - retrie"e mail from a remote mail ser"er and pass it to local S/&; agents on the local machine fdis( - used to partition hard dri"es o usage0 fdis( de/ice fg ;I5 - ring a ac(ground or stopped process with pid ##;I5$$ to the foreground! &his is a shell uiltin! If onl) one process is running in ac(ground mode, fg with no argument is sufficient to ring it to the foreground fgrep - search for patterns in files file - displa)s classification of a file or files according to the t)pe of data the) contain find - find files according to a large "ariet) of search criteria! &he find command that I use the most is o find ! -name filename -print in order to find files matching a particular name on the wor(ing director) and all su directories! ,ind can e incredi l) powerful, ut it is incredi l) o scure!

finger - displa) information a out a specified userid or userids fmt - simple text formatting utilit)! &ries to ma(e all non lan( lines nearl) the same length! fold - rea( lines of specified files so the) are no wider than a specified lengths fortune - a"aila le in the sdgames pac(age in Slac(ware and other distri utions! ;ut a call to fortune in 6etc6profile and get something inspirational or amusing e"er) time )ou fire up an xterm as a login shell! free - gi"es used and free memor) on s)stem along with other useful information fromdos - ta(es a 59S text file from stdin and sends a 1.I8 file to stdout! fsc( - file s)stem chec( and repair ftp - file transfer o"er networ(

gGG - CGG compiler gQQ - <.1 ,ortran QQ compiler gaw( - <.1 aw(, mostl) for processing delimited text files gcc - in"o(e C, CGG compiler getipts - parses arguments to a shell script! &his is a shell uiltin! get(e)codes - print (ernel$s scancode-to-(e)code mapping ta le ghostscript - set of printing utilities! It seems to e o ligator) to ha"e this if a &78 installation such as te&78 is installed! How the) communicate with one another is somewhat o scure! ghost"iew - Aladdin ghostscript interpreter6pre"iewer gimp - image manipulation and paint program glint - :ed Hat graphical front end for the rpm pac(age installer and manager! grep - used to find a string within a file! &he -i option returns matches without regard to case! &he -n option means that each line of output is preceded ) file name and line num er! &he -" option causes non-matched lines to e printed! o usage0 grep pattern files o or0 grep -i pattern files o or0 grep -n pattern files o or0 grep -" pattern files groupadd - create a new group on the s)stem groups - shows which groups )ou are in gru - <nu grand unified ootloader! Can e used instead of lilo to oot multiple operating s)stems! I encountered a couple of snafus tr)ing to install gru on m) home machine after installing /andra(e R!K and choosing the lilo ootloader during the initial install! &he /andra(e installation program set up 6 oot6"mlinuA as a s)mlin( to the actual (ernel, "mlinuA-F!@!H-FKmd(! It too( me a while to figure out that gru doesn$t understand s)m olic lin(s! &he documentation suggests installing gru on a dis(ette using the ##dd$$ command! &his refused to wor(, ut o gru -install $2fdK4$ did wor(! &he single 'uotes are necessar)! &he files necessar) to run gru are normall) located in 6 oot6gru ! 9nce the file menu!lst has een edited and appropriated entries added to oot the different operating s)stems on one$s hard dis(2s4, the following se'uence of commands can e used to install gru in the master oot record 2/B:4 sector of the hard dis(0
o o

root 2hdK,x4 setup 2hdK4

Here, the x should e replaced ) the partition where the 6 oot6gru director) is located, which is pro a l) the root partition of the Linux s)stem! .ote that gru has its own con"entions for naming de"ices and num ering partitions, so that for example a partition which is called hdaJ under Linux will e called 2hdK,C4 ) gru !

gru -install - command to install gru on the hard dri"e 2or flopp) dri"e4! gunAip - used to uncompress files compressed with gAip g" - ;ostScript and ;5, pre"iewer, ased on ghost"iew g"im - see "i gAexe - compresses executa les gAip - used to compress or decompress files halt - shut down s)stem as root, without re oot, immediatel) hash - remem ers the location of commands in the search path! &his is a shell uiltin! head - displa)s first part of a file histor) - command for "iewing and manipulating the shell command histor) list host - loo( up host names using domain ser"er hostname - used to get or set hostname! &)picall), the host name is stored in the file 6etc6H9S&.A/7! hwcloc( - used to 'uer) and set the hardware cloc( h)lafax - commercial fax program id - displa) userid and groupid inetd - daemon which starts up other daemons on demand! Configured in 6etc6inetd!conf! ifconfig - displa) 2as root4 information on networ( interfaces that are currentl) acti"e! ,irst ethernet interface should e listed as ethK, second as ethB, etc! ,irst modem ppp connection should e listed as pppK, etc! &he ##lo$$ connection is ##loop ac($$ onl)! ifdown - shut down the networ( interface ifup Dinterface-nameE - start up the interface info - displa) s)stem information! &his is the <.1 h)pertext reader! init - the mother of all processes, run at ootup, executes commands in 6etc6initta ! Can e used 2with root pri"ileges4 to change the s)stem run le"el! o usage0 init run+le/el insmod - used 2 ) root4 to install modular de"ice dri"ers installp(g - Slac(ware command to install one of the pac(ages from the program sets intr - interrupt (e), usuall) DCtrl-CE ispell - chec(s files for spelling errors o usage0 ispell files 3ed - programmer$s file editor! Beha"es li(e emacs! Has modes for &78, ,9:&:A., C, etc! 3o s - displa)s list of current 3o s in the ac(ground! &his is a shell uiltin! 3oe - simple %ordStar-li(e text editor! It can e in"o(ed in emacs emulation mode with 3emacs and in %ordStar emulation mode with 3star! 3o"e - Xoseph$s 9wn ?ersion of 7macs! A simple emacs clone! ( d-mode - print current (e) oard mode (ernelcfg - <1I to add6remo"e (ernel modules 2as root in 8 terminal4! (erneld - (ernel daemon, a process that sta)s in memor) and does all sorts of useful stuff, li(e automatic loading of de"ice dri"er modules

(i( d - a utilit) program that comes with V57 that allows users to switch on the fl) among different international (e) oards! It can e used under different window managers than (fm! (ill - sends a signal to 2especiall) to terminate4 a 3o or process! &his is a shell uiltin in ash, tcsh and Ash! (illall - (ill processes ) name! Vill all processes which are instances of the speciffied program! Also used to send signals to processes or restart them! (illallC - (ill all processes except the ones on which it depends last - generate a listing of user logins lastlog - prints the last login times of all users latex - compile a LA&78 file ldconfig - creates the necessar) lin(s and cache 2for use ) the run-time lin(er, ld!so4 to the most recent shared li raries found in the directories specified on the command line, in the file 6etc6ld!so!conf, and in the trusted directories 26usr6li and 6li 4! Ldconfig chec(s the header and file names of the li raries it encounters when determining which "ersions should ha"e their lin(s updated! Ldconfig ignores s)m olic lin(s when scanning for li raries! ldd - list the shared li raries on which a gi"en executa le depends, and where the) are located lea"e - displa) reminder at specified time less - Linux alternati"e to ##more$$ command! 5ispla)s text files, one screenful at a time! %hen less pauses, there is a large num er of a"aila le commands to tell it what to do next! 9ne can scroll oth forwards and ac(wards! let - e"aluates a numeric expression! &his is a shell uiltin! lilo - installs oot loader on the oot sector of a hard dri"e, of a dis(ette, or in another location! /) @RJ has a hard dri"e that is too large for the machine$s BI9S, so I ha"e to oot from a flopp)! &o create a oot dis(ette, I do the following 2as root40 o 6s in6fdformat 6de"6fdKHB@@K o 6s in6m(fs!extF 6de"6fdK o mount -t extF 6de"6fdK 6mnt6flopp) o cp -dp 6 oot6= 6mnt6flopp) o 6s in6lilo -C 6etc6lilo!flop &he -C option to lilo has lilo use the lilo!flop file instead of the default lilo!conf!

linuxconf - interacti"e tool for configuring Linux s)stem! 1ses 8 if loaded! &his is a <nome tool! It comes with m) :ed Hat distri ution, and is not included with Slac(ware! It would seem to e the easiest wa) to configure Linux under Slac(ware! ?ersion B!BC is a"aila le for Slac(ware! &here is a prett) good introduction to the use of linuxconf in the :ed Hat C!F installation manual, which is a"aila le online at their we site! ln - creates a lin( to a file! 1sed to create hard lin(s and, with the -s option, s)m olic lin(s which can lin( files on different dis( partitions! &he s)ntax is o ln DoptionsE source DdestE

locate filename - find the file name which contains the string ##filename$$! &he s)ntax is easier than the find command! loc( - temporaril) loc( terminal loc(file - create semaphore file2s4, used to limit access to a file - log in to s)stem logname - consult 6etc6utmp for user$s login name logout - execute logout as indi"idual user and ring up login0 prompt loo( - loo( for strings in files lp' - show print 3o s that are waiting lpr - send file to e printed lprm - cancel a 3o from print 'ueue ls - list director) contents! &o get colored director) listings under :ed Hat, /andra(e, etc!, use o ls -color &o get this all the time, add
o

alias ls*$ls -color*auto$

to ! ashrc! &he following command


o

alias ls*$ls -,s( -color*auto$

will gi"e director) listings in color, with file siAes in (ilo )tes, and append a character to the file to indicate its t)pe!

lsattr - list attri utes of files in extF file s)stem lsmod - used 2 ) root4 to show (ernel modules currentl) loaded lspci - utilit) to displa) information on pci uses and hardware de"ices attached to them! ;art of the pciutils pac(age that comes with man) Linux distri utions! lspnp - utilit) to displa) information a out pnp de"ices! ;art of the pcmcia or (ernel-pcmcia pac(age, depending on the distri ution! m@ - an implementation of the traditional 1.I8 macro processor! It can e used with the sendmail configuration pac(age in :ed Hat 2and Slac(ware4 to generate a sendmail!conf configuration file without ha"ing to edit the configuration file directl)! magicfilter - general purpose printer filter! See apsfilter a o"e! apsfilter is the printer filter that comes with the :ed Hat and Slac(ware distri utions! mail - sends or reads electronic mail ma(e - (eeps a set of programs current! &his is a utilit) that helps when de"eloping a set of programs! It wor(s ) executing a script called ma(efile, /a(efile or <.1ma(efile in the wor(ing director)! It is "er) often used in com ination with configure when compiling and installing noncompiled software pac(ages! ma(e ootdis( - command in Slac(ware to do 3ust what the name sa)s /AV757? - executa le script to ma(e de"ice files on 6de"

ma(eswap - configures swap space man - displa)s information from online 1nix reference manual manpath - attempt to determine path to manual pages mc - /idnight Commander file manager and "isual shell mesg - ena les6disa les reception of messages minicom - terminal program m(dir - create a director) m(fs - create a file s)stem 2format4 on a de"ice or partition! Should e in"o(ed after lowle"el formatting of the dis( using fdformat! It has se"eral "ersions which are all lin(s to the asic program, such as m(fs!extF and m(fs!msdos! m(swap - creates a Linux swap space on the specified hard dis( parition 2root pri"ileges neede4 o usage0 m(swap de/ice more - list file contents, stopping after each full screen mount -t Dfst)peE Dde"iceE DmountpointE - mount de"ice using files)stem of t)pe Dfst)peE with de"ice name Dde"iceE at the location DmountpointE in the files)stem director) tree mount -a - mount all files)stems according to the specifications in 6etc6fsta mouseconfig - mouse configuration utilit) under :ed Hat! Located in 6usr6s in! mpage - print multiple pages per sheet on a ;ostscript printer! Can also e used to print a page in landscape mode! /tools - pac(age of /S-59S utilities! Includes the following commands! o mcd - changes wor(ing director) on 59S dis( o mcop) - copies 59S files from one director) to another o mdel - deletes 59S files o mdir - lists contents of 59S directories o mformat - adds 59S formatting information to a dis( o mt)pe - displa)s contents of a 59S file &he default de"ice for execution of these commands is 6de"6fdK and can e referred to as ##a0$$!

m" - mo"es 2renames4 files netconf - used 2as root4 to set up networ( newaliases - re uilds the 6etc6aliases data ase used ) sendmail! /ust e rerun e"er) time 6etc6aliases is modified for the changes to ta(e effect! newgrp - similar to login! Changes user$s identification nice program-name - sets the priorit) of the program ##program-name$$! nm - lists the s)m ols from o 3ect files o 3file! If no o 3ect files are gi"en as arguments, nm assumes #a!out$! nohup - runs a command that (eeps running after logout! &he command is in principle immune to hangups, and must ha"e output to a non tt)! According to #inux in a Nutshell, this is necessar) onl) in the Bourne shell, since modern shells preser"e ac(ground processes ) default! nts)s" - run le"el editor under :ed Hat! &his is the e'ui"alent of t(s)s", ut does not re'uire a graphical interface!

nxterm - color xterm program! &he man page for nxterm under :ed Hat rings up the same page as xterm! od - dumps contents of a file passwd - change login password paste - 3oins corresponding lines from files patch - updates source code! Attempts to update a file from a file of change information, or pathces, created ) diff! pathch( - determine "alidit) and porta ilit) of filenames pdflatex - part of the pdftex program suite! ;roduces pdf output from a LA&78 file! pdftex - produces pdf output from a &e8 file! See also pdflatex! &his program is part of the tetex K!I distri ution that is included with :ed Hat C!F and a o"e, and with Slac(ware @!K and a o"e! It is also a"aila le as a separate program! perl - practical extraction and report language pg - displa) data one screenful at a time pico - simple screen oriented text editor! It is included as part of the ;ine program! ping - chec( if Internet computer is responding! Can also measure the time it ta(es the 'ueried computer to respond! p(gtool - Slac(ware tool to install, uninstall and 'uer) pac(ages! ,ront end to installp(g, remo"ep(g, ma(ep(g! &he cp(gtool is the ncurses graphical "ersion of this program! popclient - retrie"e mail "ia the ;ost 9ffice ;rotocol! Supports ;9;F and ;9;H! popd - pops the top director) of the director) stac( and uses cd to change to that director)! &his is a shell uiltin! pr - paginates files for printing printen" - displa) list of en"ironment "aria les printtool - run 2as root4 in an 8 terminal to configure )our printer2s4 ps - displa)s status of processes! 1se the -a option for processes for all users! 1se the -x option to include processes not attached to a terminal! pstree - displa) processes in the form of a tree structure! Villing a parent process will also (ill all the children and their descendants! pushd - pushes the argument onto the top of the director) stac( and uses cd to change to that director)! &his is a shell uiltin! pwd - print a solute path of wor(ing director)! &his is a shell uiltin! pwch( - chec(s the integrit) of password and shadow files pwcon" - con"erts passwords to the shadow password format pwuncon" - uncon"erts passwords from the shadow password format! <enerates a standard 1nix password file! p)thon - interpreted, interacti"e, o 3ect-oriented programming language rcp - cop) one or more files to or from remote computer! &he s)ntax is poorl) explained in the documentation that I ha"e, including the man pages! 1sage is0 o rcp filename usernameYremotehost0path &he user$s home director) on the remote s)stem must contain the file !rhosts with a list of users 2preceded ) the full domain name or exact I; address of their machine4 with access pri"ileges!

localhostname username rcs - creates or changes the attri utes of an :CS file! Stands for :e"ision Control S)stem! rde" - 'uer)6set image root de"ice, swap de"ice, :A/ dis( siAe, or "ideo mode in (ernel read - reads line from standard input! &his is a shell uiltin! readonl) - declares a "aria le to e read onl)! &his is a shell uiltin! re oot - in Slac(ware, re oots the s)stem! Seems to e e'ui"alent to shutdown -r now in generic Linux! renice program-name - resets the priorit) of process ##program-name$$! reset - used to reset the screen characteristics! &his is useful if the screen gets messed up from, for example, tr)ing to displa) a inar) file in an xterm! return - exits from a function! &his is a shell uiltin! rlog - prints a summar) of the histor) of an :CS file rlogin - log in to remote computer! &he general s)ntax is as follows, using the 1WA/ .o el machine as an example0 o rlogin -l userid no el!si!u'am!ca
o

&he remote computer must recogniAe the local user and the local machine! See the rcp command for how to set up the !rhosts file on the remote machine!

rm - remo"e files or directories! %ith the -r 2recursi"e4 option 2"er) dangerousS4, can e used to remo"e the contents of a specified director) including all su directories! rmail - interpret and handle remote mail recei"ed "ia uucp rmdir - remo"e empt) directories rmmod - used to remo"e modular de"ice dri"ers route -n - show routing ta le! &he n option returns numerical addresses rather than names! rpm - in"o(es the :ed Hat pac(age manager in command line mode! I often use this command in 'uer) mode to 'uer) pac(ages a out what files the) contain and to find out which pac(age owns a particular file! 7xamples are o rpm -'il foo! <i"es pac(age information and a file list for the pac(age foo! o rpm -'fil foo! <i"es pac(age information and a file list for the pac(age that owns the file foo! ,oo must e in the wor(ing director), or the full path to foo must e specified! %e need to find out a out installing the rpm pac(age on a Slac(ware ox! It$s pro a l) etter to use a pac(age con"erter such as alien!

rpmFtgA - an extremel) useful utilit) on Slac(ware s)stems that con"erts rpm pac(ages to tgA format! &he) can then e installed using the installp(g command 2or p(gtool4! rsh - execute shell command on a remote computer! See rcp and rlogin! rstat - summariAe host$s status0 uptime, load a"erages, and current time ruptime - show host status of local machines

rusers - list who is logged on local machines rwall - write to all users o"er a networ( rwho - show who is logged in on a LA.! &he rwho ser"ice must e ena led for this command to run! If it isn$t, run ##setup$$ as root! I don$t understand this last remar(, which comes from ##Linux .ew ie Administrator <uide$$! rx"t - a terminal program similar to xterm, ut which has less features and uses less memor) sed - edits a file 2not interacti"el)4! Also a tool for processing text files! set - set or displa) "alue of shell "aria les! &his is a shell uiltin! &he command o set P less prints the current user en"ironment, gi"ing the "alues of currentl) defined "aria les!

seten" - set or displa) "alue of en"ironment "aria les setserial - used ) root to configure a serial port setterm - set terminal attri utes for a "irtual console setuid - set the id of a program when it is run! 1sed, for example, to gi"e root pri"ileges to a program run ) an ordinar) user! &his is actuall) done ) running the chmod program as root! See the chmod command for the s)ntax! setup - Slac(ware program to set up program sets and configure s)stem! Setup de"ices and file s)stems, mount root file s)stem sh - standard 1.I8 shell! 9n Linux, 3ust another name for ash! shift - promotes each command-line argument! &his is a shell uiltin! showmount - show information a out an nfs ser"er shutdown - re oot or shut down s)stem as root, after specified amount of time! %ith the -r option, re oot! %ith the -h option, halt the s)stem! o usage0 shutdown -r minutes sleep - creates process that sleeps for specified inter"al sliplogin - attaches a SLI; interface to standard input! 1sed to allow dialin SLI; connections! sort - sorts and6or merge files split - split file into specified num er of segments ssh - secure shell! Apparentl) has man) of the same functionalities as rlogin, telnet, ftp, rsh, etc!, with etter securit) and encr)ption features! %e ma) want to learn how to set this up and use it! startx - front end to xinit in Linux! &his is a script which starts up 8 clients and shuts down the 8 ser"er on exit from the window manager! startx 0B - start the next 8 window session on the displa) B 2the default is opened on displa) K4! 9ne can switch etween different graphical displa)s using >Ctrl?>)lt?>FI?, >Ctrl?>)lt?>FZ?, etc! stt) - sets or displa)s operating options for terminal su - log in as another user, including root sudo - allows indi"idual users to ha"e root permission to perform specified tas(s swapoff - disa les swap dis( swapon - ena les swap dis(

s)mlin(s - pro"ide list of and information a out s)m olic lin(s s)nc - writes memor) uffers to ph)sical de"ices s)stat - 'uer) host for s)stem information tac - print file in re"erse tail - displa)s the last part of a file tal( - "isual communication program that copies lines from one terminal to that of another user tar - file compression and archi"ing utilit)! I find the s)ntax of this command to e frustratingl) opa'ue! &he following wor(s for me! &o use this command to unAip gAipped tar alls in "er ose mode, use o tar -x"Af filename!tgA &o create a tar all from files in a gi"en director) and its su directories, use
o

tar -c"Af filename!tgA sourcename

Sourcename can e the name of a single file, a wildcard such as =, or the name of a su director)! &here seem to e two different con"entions concerning gAipped tar alls! 9ne often encounters !tar!gA! &he other popular choice is !tgA! Slac(ware pac(ages use the latter con"ention! &he command can also e used to archi"e a file, a group of files, or a director) 2with its su directories4 on tape or onto floppies! If the material to e archi"ed exceeds the capacit) of the ac(up medium, the program will prompt the user to insert a new tape or dis(ette! 1se the following command to ac( up to floppies0
o

tar -c"f 6de"6fdK filename2s4 or director)name2s4

&he ac(up can e restored with


o

tar -x"f 6de"6fdK

&ar can e used for other things! &o mirror all the files and su directories in fromstuff to to-stuff, use the commands
o o

cd from-stuff tar cf - ! P 2cd !!6to-stuffZ tar x"f -4

.o tar file is e"er written to dis(! &he data is sent ) pipe from one tar process to another! &his example is ta(en from "unning #inux, p!BQQ! &o list the ta le of contents of a tar archi"e, use
o

tar t"f tarfile

&o extract indi"idual files from a tar archi"e, use


o

tar x"f tarfile files

where files is the list of files to extract! %hen extracting files, tar creates missing su directories underneath the current director) in which the cammand is in"o(ed!

tcl - scripting language tcsh - extended "ersion of the C shell tee - cop) standard input to standard output and one or more files telinit - used to change run le"el! 7xact run le"el that corresponds to single-user, multi-user, and 8 le"els depends on distri ution! telnet - remote login o"er networ( test - e"aluates an expression or compares arguments! &his is a shell uiltin in ash, tcsh and Ash! tftp - user interface to &,&; protocol time - displa)s times for the current shell and its children! &his is a shell uiltin! Strange, ecause there is also a 6usr6 in6time program on m) :ed Hat s)stem! tin - .etnews reader t(des( - graphical des(top file manager for 8 t(s)s" - graphical runle"el editor under :ed Hat! Allows root to configure the ser"ices that are started at each run le"el! tload - displa) s)stem load a"erage in graph format top - d)namicall) displa)s process status touch - update access and modification times of a file! If the file does not exist on dis(, an empt) file is created! tr - translation utilit) that can e used, for example, to replace specified characters in a text file trap - traps a signal! &his is a shell uiltin! true - null command that returns a successful exit status tset - initialiAes terminal tt) - shows special file that represents )our terminal! 5ispla)s the terminal pathname! t)pe - displa)s how each argument would e interpreted as a command! &his is a shell uiltin! t)peset - declares attri utes for a "ariaa le 2same as declare4! &his is a shell uiltin! ul - translate underscores to underlining umas( - esta lishes the file-creation permissions mas(! 1sage is o umas( x)A &he s)stem su tracts x, ) and A from the owner, group and other file permissions that it would otherwise assign to new files! &his is a shell uiltin!

umount Dde"iceE - finish writing to the de"ice and remo"e it from the acti"e files)stem! &he command umount -a will 2re4mount all file s)stems listed in 6etc6fsta ! unalias - remo"e name pre"iousl) defined ) alias! &his is a shell uiltin!

uname - displa)s information a out the s)stem! %ith no arguments, it displa)s the name of the operating s)stem! %ith the -a option, it displa)s information a out the operating s)stem, the host name, and hardware! uni' - displa)s lines of a file that are uni'ue unset - remo"es a "aria le or function! &his is a shell uiltin! unAip - uncompress files compressed with the Aip utilit), compati le with 59S ;VAip updated - update file data ase used ) locate command uptime - shows the time, how long the s)stem has een up, the num er of users, and a"erage load! useradd - same as adduser userdel - remo"e an account 2as root4! &he user$s home director) and undeli"ered mail must e dealt with separatel)! users - prints list of users on the s)stem "dir - "ariant of the <.1 "ersion of the ls command! 5efaults to printing out the long "ersion of director) entries! "i - standard screen oriented 1nix editor "iew - "i in read-onl) mode "im - impro"ed "i editor "rf) - 'uer) remote host to "erif) the accurac) of an email address w - displa) info a out userids and acti"e processes wait - waits for a ac(ground process to terminate! &his is a shell uiltin! wc - displa)s num er of lines, characters and words in a file %harf - the AfterStep application doc( module whatis - displa) one-line summar) of specified command whereis - use to find utilities in standard locations which - used to find utilities in search path! %ill return the a solute director) path of the named utilit) program! who - displa) information a out currentl) logged in userids whoami - displa) information a out userid that is currentl) logged in wish - front end to t(, an 8 window extension of tcl wor( one - console ased cd pla)er wor(man - graphical cd pla)er program write - send messages to another local user 8 - starts up the 8 ser"er! Can e in"o(ed with o 8 -'uiet -'uer) remotemachineaddress in order to get a graphical login screen on the remote machine! See the discussion in connection with xdm elow!

xadm - displa) ad"anced power management BI9S information xargs - con"erts standard output of one command into arguments for another! &his is one of those powerful ut o scure commands! 8args reads arguments from the standard input, delimited ) lan(s 2which can e protected with dou le or single 'uotes or a ac(slash4 or newlines, and executes the command 2default is

6 in6echo4 one or more times with an) initial-arguments followed ) arguments read from standard input! Blan( lines on the standard input are ignored! x iff - graphical mail deli"er) notification utilit) xcalc - simple calculator program xclip oard - name sa)s it all 8configurator - :ed Hat utilit) for configuring settings for 8 xdm - used to start an 8 login session! &his can e used to start a login session on a remote s)stem! See the discussion on the following site0
o httpJ--www0menet0umn0edu-Wkas1eta-unix-xterminal-index0html

See the man pages for 8, xdm, and 8ser"er! As usual, the man pages are prett) o scure! &he est single source seems to e the 8ser"er man pages! After 8 is configured, 8 needs to e started at ootup with the command 2in 6etc6rc!d6init!d6xterm40
o

8 -'uiet -'uer) remotemachineaddress

If the address of a nameser"er is not configured, then the numeric address of the remote machine rather than its name should e entered! If the machines are connected through ethernet cards and the net, then o "iousl) asic networ(ing has to e set up! <nome and V57 come with their own "ersions of 8 displa)6login managers, called respecti"el) gdm and (dm!

xd"i - "iew a d"i file compiled under LA&78 xedit - a simple text editor for 8 xfRJconfig - graphical configuration tool for 8 8,RJSetup - graphical configuration tool for 8 xfd - displa) an a"aila le font in 8! Creates a grid in an x-term with one character per rectangle! xfig - utilit) for interacti"e generation of figures xfm - graphical file manager for 8 xhost - tell 8 ser"er that remote computer has access to )our machine and that )ou will use the remote computer! &his can e used to set up remote 8 sessions! &o set up a remote 8 session on the 1WA/ .o el machine, run the following command on the local machine 2one doesn$t ha"e to e root to do this4 o xhost Gno el!si!u'am!ca &hen, log onto the remote machine using rlogin 2see a o"e4 or telnet! 9nce logged in, use the following command to get the remote 8 ser"er to open an 8 terminal on the local machine0
o

seten" 5IS;LAL localhostname0K Z xterm U

&his is "alid for csh, which is the default login shell on .o el! ,or (sh, 2and I thin( ash4 replace with

o o

5IS;LAL*localhostname0K export 5IS;LAL Z xterm

9ther 8- ased programs such as .etscape or <auss 2graphical "ersion4 can also e run on a remote machine with displa) on the local machine with little trou le! &he local 8 ser"er is the program that has all of the information concerning the properties of the graphics card and terminal, so it must e necessar) to ha"e 8 running on the local machine! &he following should also wor(! After using xhost to gi"e permission to the remote machine to displa) on the local machine, use
o

netscape -displa) localhostname0K!K

Wuestion0 can one start the 8 session on the local machine and then run a remote cop) of a window managerO

xinit - start 8 %indow! &he command startx is a front end to xinit in Linux, including Slac(ware! xload - displa)s a graphic of the s)stem load xlp' - graphical interface to print manager! &his is included on one of the 8,C7 menus, ut does not seem to e a part of the ase :ed Hat distri ution! xlsfonts - list fonts a"aila le under the 8 %indow s)stem! xman - rowsa le command reference! 5ispla)s manual pages under 8! xmh - graphical front end under 8 to the nmh mail handling s)stem! &his program is part of the 8,reeRJ pac(age in :ed Hat! xmodmap - utilit) for modif)ing (e)maps and pointer utton mappings in 8! Can e used to install a ,rench Canadian (e) oard! 5ownload the 8modmap!cf file from www!linux-'ue ec!org, and insert the command o xmodmap 6etc68BB68modmap!cf U into the !xession 2with xdm4 or the !xinitrc 2with startx4 file!

xos"iew - displa)s ar graphs of s)stem load, load a"erage, memor) usage, and swap usage xpaint - simple paint program for 8 xpdf - <;L$d utilit) for pre"iewing d"i files! 5oesn$t seem to wor( too well on texts with a lot of math! xpla)cd - 8 %indow audio cd pla)er utilit) xsetroot - utilit) to configure root window of an 8 terminal xs)sinfo - graphical displa) of load and memor) usage xterm - start an 8 %indow terminal session xterm-color - color "ersion of xterm x" - utilit) for "iewing and manipulating man) t)pes of image files! &his is a shareware program! x"idtune - utilit) for fine tuning of monitor settings under 8 )acc - parser generator )tal( - multi-user program similar to tal(

Acat - read one or more files that ha"e een compressed with gAip or compress and write to standard output Acmp - read compressed files and pass them to cmp Adiff - read compressed files and pass them to diff Agrep - read compressed files and pass them to grep Zharf - AfterStep utton panel module Aip - Aip utilit) compati le with 59S ;VAip Aless - "iew Aipped files Amore - print contents of compressed files one screen at a time Anew - uncompress Z files and recompress in !gA format

7"entuall), we want to e a le to distinguish etween commands that are an intrinsic part of the (ernel, commands that are executa le inaries that come with e"er) distri ution of Linux, executa le inaries that are not pro"ided with all distri utiions of Linux, and executa le shell scripts! %e also want to point out the t)pical location of these commands on different Linux distri utions! ,inall), we want to distinguish etween shell commands and Linux commands!

1/ 0otes on Applications
45.4 ail T!ans"e! A#ents ? TAs@

&he Linux distri utions I (now come with sendmail, except for /andra(e, which as of "ersion Q!B uses ;ostfix as its default /&A! &here are se"eral competing programs a"aila le! 7"en the simplest don$t seem to e that eas) to configure!

7xim ,etchmail - seemingl) one of the few wa)s 2;ine is a le to do this as well4 to download mail automaticall) from a ;9; or I/A; ser"er and pass it to local mail handling agents! 1se the following line in 6!fetchmailrc0 o poll pop!u'am!ca proto popH user 1S7:.A/7 pass ;ASS%9:5 1se the following to ha"e fetchmail loaded as a daemon that will download mail at regular inter"als0
o

fetchmail -d JKKK

&he inter"al is specified in seconds! ,etchmail will poll all of the pop ser"ers listed in 6!fetchmailrc!

<etmail - 5esigned as a replacement for ,etchmail! //5, ;ostfix - a mail transport agent and potential replacement for sendmail! /andra(e Q!B and up uses this as its default /&A!

Wmail - a ##modern$$ replacement for sendmail! It is reputed to e more secure than sendmail! Since it doesn$t ha"e a <;L license, it is not the default /&A of an) Linux distri utions that I (now of! Sendmail - this one gets m) "ote for the most complicated and o scure configuration file, 6etc6sendmail!cf! /ost indi"idual Linux users will e using machines connected to the Internet "ia an IS; or on networ(s 2such as uni"ersit) networ(s4 with centraliAed mail processing and access to the net! I ha"e to change the following lines in sendmail!cf to e a le to send mail with emacs! o 5/u'am!ca < mas'uerade the domain name o 5.am ler!ste"en < mas'uerade username o 5Sno el!si!u'am!ca < rela) all mail through no el ser"er &he pro lem comes from the fact that, as a user on a local networ(, I don$t ha"e m) own domain name! I want return mail to e routed to 1WA/$s mail ser"er and I want the ser"er to handle all m) mail for me, e"en mail to other 1WA/ users! If I send mail to 1WA/ users using their normaliAed usernames, the net does not (now who or where the) are! I ha"e managed to get a configuration that wor(s ) writing a sendmail!mc file and processing it with the m@ macro interpreter, following the Address-:ewriting mini-H9%&9! I now ha"e something that wor(s, ut which m)steriousl) complains a out ##dangerous write permissions$$ e"er) time the s)stem oots up!

Smail - seems to e a popular choice on smaller s)stems! It would appear that at one point in its histor), :ed Hat shipped with smail, ut this has een replaced with sendmail! Zmailer - apparentl) designed for mail ser"ers with a large num er of users!

45.>

ail (se! A#ents ? (As@


Acmemail - %e - ased mail agent! Allows )ou to access )our mail with an) rowser! In"ol"es setting up a ;erl C<I script on the ser"er side! Archimedes - A successor program to 8,mail 2see elow4 Arrow Balsa - the default <nome mail program BlitAmail 7lm 7mumail - %e - ased mail agent! Allows )ou to use an) rowser to chec( )our ;9; mail account! &he %e site of the compan) that ma(es this one can e used to chec( )our mail on a 1nix s)stem without setting up an) C<I script on the ser"er side! 7"olution - mail reader and contact manager6calendar designed for use under <nome 7xmh - graphical front end for /h Vmail - mail reading program included with V57

/ - for ##/ahogan)$$! Seems similar to 8,mail 2see elow4! I ha"en$t een a le to figure out from the description whether it runs independentl) of or in con3unction with sendmail and procmail! /h /umail /utt - text ased mail program, which is highl) configura le! .mh - mail handling s)stem! &his s)stem includes a large num er of inar) commands that are (ept in 6usr6 in! See the man page for nmh for details! :ed Hat C!B and C!F come with exmh and xmh, which are graphical front ends for nmh! &he exmh front end is a separate pac(age, while xmh is owned ) 8,reeRJ! ;ine - text ased mail and news utilit)! ,eatures now include0 o /I/7 support o a ilit) to read and post networ( news o maintenance of an address oo( of mail recipients o spell chec(ing during message composition o mouse support when using xterm on an 8 %indow s)stem o a highl) configura le en"ironment ;ine can e used to download mail from one or more ;9;H mail ser"ers! See &ip of the %ee( 2httpJ--tipoftheweek0darkelf0net4 for the fourth wee( of ,e ruar) BIII! ,irst, set up multiple configuration files 2pine -p localmail, pine -p popser"er B, pine -p popser"er F, etc!4! &hen, to configure ;ine to use a ;9;H ser"er, use the Setup Config command! Set something li(e this in the in ox-path0
o

[pop!ser"er!com6popH6user*m)id\I.B98

%hen ;ine is restarted, it should as( for )our password, connect to the remote ser"er, and use it is if it were accessing local mail! &he article is unclear on whether there is the option of lea"ing copies of the downloaded mail on the ser"er!

S)lpheed 8Cmail 8,mail - &his one seems "er) promising! It$s a <1I- ased mail tool that seems to offer most of the features of .etscape$s mail module! It runs without using sendmail and procmail, which is a ma3or ad"antage!

45.A Edito!s

cooledit - a prett) powerful <1I text editor emacs - powerful text editor that includes modules for reading and sending mail and postings to newsgroups, and a rowser module! ,or editing &78 and LA&78 files, the Auc&78 addon pac(age is in"alua le, and ma(es emacs prett) hard to eat as an editor with LA&78! 3ed - has prett) good emacs emulation 2it can e"en read mail li(e emacsS4! It does simple s)ntax highlighting for &e8 files, including gi"ing positioning of

parentheses! It would seem to e prett) configura le and ta(es up much less dis( space than emacs, although more than 3oe and muemacs! It wor(s well in console mode, and still manages to use colors for menu ars and s)ntax highlighting! &he program x3ed which comes with some "ersions starts up its own 8 terminal when in"o(ed! 3oe - +Xoe$s 9wn 7ditor+, a fairl) powerful editor with a compact inar) and an a ilit) to emulate %ordstar, 7macs, ;ico, and a few other editors! 3o"e - +Xoe$s 9wn ?ersion of 7macs+! I tried this out a couple of times and managed to crash it when ma(ing some minor errors in command s)ntax! microemacs 2XASS;A4 - spinoff of muemacs! ;rett) powerful and configura le, while not ta(ing up too much dis( space or memor)! muemacs - a fairl) powerful emacs clone whose inar) is actuall) smaller than that of the Xoe editor! nedit - an 8 %indow ased text editor! 9f all text editors for Linux that I$"e seen, it has commands which are closest to %indows text editors, for cursor mo"ement, highlighting, mar(ing text, etc! It has "er) good s)ntax highlighting for oth LA&78 and H&/L! pico - simple text editor! It often comes pac(aged with the ;ine mail user agent! "i - included with most Linux distri utions! If )ou$re not used to the s)ntax, it can e prett) hard to understand! "im - impro"ed "ersion of "i xedit - simple text editor included with man) Linux distri utions

45.B Othe!

dfm - 5es(top ,ile /anager! Allows the user to place program icons on the des(top! gmc - <nome /idnight Commander! <nome "ersion of /idnight Commander! Includes a graphical interface and allows the user to place icons on the des(top! mc - /idnight Commander file manager! :uns in console mode and in an xterm! scila - a free matrix programming language! /a) e a good su stitute for <A1SS and6or /A&LAB!

11 Some 0ifty Slo-ans


Linux0 the choice of a <.1 generation! %indows0 where do )ou want to go toda)O Linux0 where do )ou want to go tomorrowO &his program has performed an illegal operation and will e shut down0 please re oot using Linux! ##%hen )ou sa) #I wrote a program that crashed %indows$, people 3ust stare at )ou lan(l) and sa) #He), I got those with the s)stem, for free$!$$ - Linus &or"alds %indows FKKK, from the compan) that rought )ou 75LI.S

Linux0 ecause re ooting is for adding new hardware! Lour mouse has mo"ed! %indows .& must e restarted for the change to ta(e effect! :e oot now D9VEO Linux0 transforms )our microcomputer into a wor(station! %indows .&0 transforms )our wor(station into a microcomputer!

12 1eferences
Computer &echnolog) 5ocumentation ;ro3ect 2C&5;4 2FKKKa4, ##How Linux %or(s$$,
httpJ--ctdp0tripod0com-os-linux-howlinuxworks-index0html

Computer &echnolog) 5ocumentation ;ro3ect 2C&5;4 2FKKK 4, ##Linux ,iles and Command :eference$$, httpJ--ctdp0tripod0com-os-linux-commands-index0html Vlimas, ;iotr et! al! 2BIII4, ##Linux .ew ie Administrator <uide$$,
httpJ--sunsite0dk-linux newbie-

Sie"er, 7llen, Stephen Spainhour, Xessica ;! He(man, and Stephen ,iggins 2FKKK4, #inux in a Nutshell! third edition, 9$:eill) So ell, /ar( <! 2BIIR4, ! 2ractical 3uide to #inux! Addison-%esle) SSC 2FKKK4, ##Bash :eference Card$$, httpJ--www0ssc0com-ssc-bash- bash0pdf %elsh, /att, /atthias Valle 5alheimer and Lar Vaufman 2BIII4, "unning #inux! third edition, 9$:eill) and Associates

S-ar putea să vă placă și