<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-345201392220129351</id><updated>2011-11-27T15:17:55.321-08:00</updated><category term='Unix'/><title type='text'>Unix FAQ's</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://unixfaq.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://unixfaq.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>sandy</name><uri>http://www.blogger.com/profile/02503582209971047801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-345201392220129351.post-303462710008777370</id><published>2009-02-24T23:29:00.000-08:00</published><updated>2009-02-24T23:30:02.637-08:00</updated><title type='text'>Fundamental Unix Commands</title><content type='html'>&lt;p align="center"&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;b&gt;&lt;span style="font-size:180%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;So now you're logged in. Great. Now what? Unix does not present itself to you through an interface that is graphical (GUI). You know, the screen full of icons and pictorial symbols and menus for you to interact with using your mouse. While using linux on the remote server, you won't even touch your mouse. I'm not bragging, mind you, I'm not saying that's good. Just pointing it out. What the operating system &lt;i&gt;does &lt;/i&gt;present is merely a prompt. A symbol that mutely stares at you waiting. For anything to happen, you're supposed to type in a command. In &lt;i&gt;its &lt;/i&gt;language, not yours. So you have to know one. That requires you to learn the commands that Unix has. As opposed to a graphical interface, this style of interaction is called a command-driven or character-based interface.&lt;/p&gt; &lt;p&gt;By the way, note I didn't say that Unix does not have a graphical user interface (because it does). I only said it doesn't &lt;i&gt;present itself &lt;/i&gt;to you that way. Unix has an optional GUI, called the X windowing system, that can be started by issuing a certain command while in the character-based interface. But not while using telnet or ssh. So in this course, primary focus is on Unix used through its command-driven interface.&lt;/p&gt; &lt;p&gt;The point is that to get beyond the prompt, you have to start learning some commands. Right now. So you won't be stuck. Using Unix effectively in command mode means mastering the use of certain commands. &lt;/p&gt; &lt;p&gt;There are a whole lot of commands. Every beginning Unix tutorial seems to pick its own shortlist. The ones it thinks are the top priority. A kind of "top 10." While no particular pick is sacrosanct, it's not too hard for experienced Unix users to agree on certain high-frequency commands you should know.&lt;/p&gt; &lt;p&gt;What does "know" mean? How deeply? Commands generally have a lot of formal "options." These appear in their documentation. As an example, the ls command is for the purpose of listing the contents of a directory. At its simplest people use it by typing "ls, " nothing more, and pressing the enter key. A list of filenames typically appears (try it). However, ls has an option called -l (the letter ell) which prints out a little more information about each file, in a different format. And another, the -t option, that sorts the file list into chronological order. And forty-eight other options that appear in the documentation for the ls command. You don't need to know them all. But among them there are just a few that make life easier if you know them (or harder if you don't). And it's the same for the other commands.&lt;/p&gt; &lt;p&gt;&lt;a name="list"&gt;&lt;/a&gt;I want to call to your attention a list of arguably "most important" commands. And for each, to its "most important" options. And I want you to familiarize yourself with each command option through actual use. Here's my list:&lt;/p&gt; &lt;p&gt;ls - list directory contents (like MS-DOS dir)&lt;br /&gt;cat - send file content to screen  (like MS-DOS type)&lt;br /&gt;cd - change current directory (like MS-DOS cd)&lt;br /&gt;chmod - change file permissions&lt;br /&gt;cp - copy files and directories (like MS-DOS copy)&lt;br /&gt;echo - write characters to the screen&lt;br /&gt;find - find files (slow but fresh)&lt;br /&gt;locate - find files (faster but stale)&lt;br /&gt;grep - print lines matching a pattern&lt;br /&gt;less - file filter for viewing&lt;br /&gt;man - display on-line manual pages for individual commands&lt;br /&gt;mkdir - make directories  (like MS-DOS md)&lt;br /&gt;mv - rename/move files  (like MS-DOS ren or move)&lt;br /&gt;ps - give a process status report&lt;br /&gt;pwd - print name of the current, working directory&lt;br /&gt;rm - remove files and directories  (like MS-DOS del)&lt;br /&gt;rmdir - remove empty directories  (like MS-DOS rd)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here are the several variations of each command you should become familiar with:&lt;/p&gt; &lt;p&gt;ls&lt;br /&gt;list directory contents&lt;/p&gt; &lt;span style="font-family:Times New Roman;font-size:85%;"&gt; &lt;p&gt;&lt;span style="color:#0000ff;"&gt;[david@EMACH2 fish]$ ls&lt;br /&gt;salmon trout&lt;/span&gt;&lt;/p&gt; &lt;/span&gt;&lt;p&gt;ls -l&lt;br /&gt;long listing&lt;/p&gt; &lt;span style="font-family:Times New Roman;font-size:85%;"&gt; &lt;p&gt;&lt;span style="color:#0000ff;"&gt;[david@EMACH2 fish]$ ls -l&lt;br /&gt;total 8&lt;br /&gt;-rw-r--r-- 1 david david 7 Jan 9 2000 salmon&lt;br /&gt;-rw-r--r-- 1 david david 6 Jan 9 2000 trout&lt;/span&gt;&lt;/p&gt; &lt;/span&gt;&lt;p&gt;ls -F&lt;br /&gt;displays a slash after each directory, asterisk after each executable file, at sign after symbolic links&lt;/p&gt; &lt;p&gt;ls -a&lt;br /&gt;displays all files, including invisible ones (those whose filenames begin with a period)&lt;/p&gt; &lt;p&gt;ls -t&lt;br /&gt;displays files in order by the time of last modification&lt;/p&gt; &lt;p&gt;ls -R&lt;br /&gt;recursively lists subdirectories&lt;/p&gt; &lt;span style="font-family:Times New Roman;font-size:85%;"&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;[david@EMACH2 animal]$ ls -R&lt;br /&gt;.:&lt;br /&gt;amphibian bird fish insect mammal reptile&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;amphibian:&lt;br /&gt;frog newt&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;bird:&lt;br /&gt;crow robin&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;fish:&lt;br /&gt;salmon trout&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;insect:&lt;br /&gt;ant mosquito&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;mammal:&lt;br /&gt;cat horse&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;reptile:&lt;br /&gt;lizard turtle&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;cd&lt;br /&gt;makes your home directory the current, working directory (see pwd)&lt;/p&gt; &lt;span style="font-family:Times New Roman;font-size:85%;"&gt; &lt;p&gt;&lt;span style="color:#0000ff;"&gt;[david@EMACH2 log]$ pwd&lt;br /&gt;/var/log&lt;br /&gt;[david@EMACH2 log]$ cd&lt;br /&gt;[david@EMACH2 david]$ pwd&lt;br /&gt;/home/david&lt;/span&gt;&lt;/p&gt; &lt;/span&gt;&lt;p&gt;cd &lt;fully&gt;&lt;br /&gt;makes the specified directory the current, working directory&lt;/p&gt; &lt;span style="font-family:Times New Roman;font-size:85%;"&gt; &lt;p&gt;&lt;span style="color:#0000ff;"&gt;[david@EMACH2 david]$ cd /usr/src/linux&lt;br /&gt;[david@EMACH2 linux]$ pwd&lt;br /&gt;/usr/src/linux&lt;/span&gt;&lt;/p&gt; &lt;/span&gt;&lt;p&gt;cd &lt;relative&gt;&lt;br /&gt;makes the specified directory, which must be under the initial working directory, the new working directory&lt;/p&gt; &lt;span style="font-family:Times New Roman;font-size:85%;"&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;[david@EMACH2 taxonomy]$ pwd&lt;br /&gt;/home/david/taxonomy&lt;br /&gt;david@EMACH2 taxonomy]$ ls -F&lt;br /&gt;animal/ mineral/ vegetable/&lt;br /&gt;[david@EMACH2 taxonomy]$ cd mineral/&lt;br /&gt;[david@EMACH2 mineral]$ pwd&lt;br /&gt;/home/david/taxonomy/mineral&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;cp &lt;source&gt; &lt;destination&gt;&lt;br /&gt;creates a copy of the source file, applying the given destination file name to it&lt;/p&gt; &lt;p&gt;cp &lt;source&gt; &lt;destination&gt;&lt;br /&gt;creates a copy of the source file, without changing its name, in the given destination directory&lt;/p&gt; &lt;p&gt;cp -r &lt;source&gt; &lt;destination&gt;&lt;br /&gt;recursive. If any of the source files is a directory, all its contents plus those of any of its subdirectories are copied into the given destination directory&lt;/p&gt; &lt;p&gt;cp -p&lt;br /&gt;preserves each file's characteristics when copying it (owner, group, permissions, modifications times)&lt;/p&gt; &lt;p&gt;mv Afile B&lt;br /&gt;renames a file (Afile is an existing file, B is a new name for it)&lt;/p&gt; &lt;p&gt;mv Xdir Y&lt;br /&gt;renames a directory (Xdir is an existing directory, Y is a new name for it)&lt;/p&gt; &lt;p&gt;mv Afile Xdir&lt;br /&gt;moves a file into a specified directory (Afile is an existing file, Xdir is an existing directory)&lt;/p&gt; &lt;p&gt;rm -i &lt;file-list&gt;&lt;br /&gt;removes files, interactively (asks before removing each file)&lt;/p&gt; &lt;p&gt;rm -f &lt;file-list&gt;&lt;br /&gt;removes files with "force" (doesn't ask)&lt;/p&gt; &lt;p&gt;rm -r &lt;file-list&gt;&lt;br /&gt;removes files recursively, including those found in all subdirectories of the one specified (or current working directory if none specified) &lt;/p&gt; &lt;p&gt;rm -rf *&lt;br /&gt;removes all files in the current and subordinate directories, and also those directories. Potentially dangerous if executed from within the wrong directory.&lt;/p&gt; &lt;p&gt;cat Afile Bfile &gt; Cfile&lt;br /&gt;concatenate (paste together end to end) contents of two files, send result (&gt;) to a new file (result: C = A + B)&lt;/p&gt; &lt;p&gt;cat /etc/lilo.conf&lt;br /&gt;extract contents of the file, send result to the terminal&lt;/p&gt; &lt;p&gt;cat -n&lt;br /&gt;number the lines as they are output&lt;/p&gt; &lt;p&gt;cat --show-all&lt;br /&gt;show non-printing as well as printing characters (e.g., tabs, linefeeds)&lt;/p&gt; &lt;p&gt;man &lt;command&gt;&lt;br /&gt;display documentation for the named command, explaining all its options just as we're doing here&lt;/p&gt; &lt;p&gt;less&lt;br /&gt;prints contents of a file (or other input) one screenful at a time to prevent scrolling out of sight. Press enter to advance a line, spacebar to advance a full screen, : q to exit.&lt;/p&gt; &lt;p&gt;grep &lt;target&gt; &lt;files&gt;&lt;br /&gt;searches for a pattern in files. Frequently used to print all lines in file containing a certain word or phrase&lt;/p&gt; &lt;p&gt;&lt;command&gt; | grep &lt;target&gt;&lt;br /&gt;searches the output produced by a command (in place of the contents of a file) for a pattern&lt;/p&gt; &lt;p&gt;grep -v &lt;target&gt;&lt;br /&gt;reverses search outcome, searching for lines the do NOT contain the target pattern&lt;/p&gt; &lt;p&gt;ps&lt;br /&gt;process status. Displays status information about active processes that your terminal controls including PID (process id) numbers&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:85%;color:#0000ff;"&gt;[david@EMACH2 david]$ ps&lt;br /&gt;PID TTY TIME CMD&lt;br /&gt;1235 pts/0 00:00:00 bash&lt;br /&gt;1820 pts/0 00:00:00 ps&lt;/span&gt;&lt;/p&gt; &lt;p&gt;ps ax&lt;br /&gt;displays status information about all processes&lt;/p&gt; &lt;p&gt;chmod u+r &lt;file-list&gt;&lt;br /&gt;add to or remove from (+ or -) a file(s) any of 3 different kinds of permission (r or w or x) for any of 3 different user constituencies (u or g or o)&lt;br /&gt;used to restrict/extend access to others, and to enable script execution&lt;/p&gt; &lt;p&gt;chmod 777&lt;br /&gt;same, simultaneously setting multiple permissions using a numeric notation&lt;/p&gt; &lt;p&gt;locate &lt;filename&gt;&lt;br /&gt;search for files on the computer (fast and stale)&lt;/p&gt; &lt;p&gt;find / -name &lt;targetfile&gt; -print&lt;br /&gt;search for files on the computer (slow and fresh)&lt;/p&gt; &lt;p&gt;Note that there are a number of different kinds of "Unix." And there are some command differences among them. They have the great majority of the commands in common, but sometimes a command with which you are familiar in one version of Unix isn't included in another one. One of the kinds of Unix that is widely popular is called FreeBSD. The one used on the remote server is Linux. Are such different versions the same?? They are like &lt;i&gt;different&lt;/i&gt; dialects of the &lt;i&gt;same&lt;/i&gt; language (English in New Zealand, Canada, Scotland, South Africa, ...). There is both a little difference and a lot of similarity. But a lot more same than different.&lt;/p&gt; &lt;p&gt;Below are some links to other peoples' "top 10" command sets, and a linux command "cheatsheet" you might print out. Spend some time exploring them.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.justlinux.com/nhf/Command_Reference"&gt;One&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.control-escape.com/lx-translate.html"&gt;... and another&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Linux command cheatsheet:&lt;br /&gt; &lt;a href="http://homepage.smc.edu/morgan%5Fdavid/cs40/images/command-cheatsheet1.jpg"&gt;page1&lt;/a&gt;  &lt;a href="http://homepage.smc.edu/morgan%5Fdavid/cs40/images/command-cheatsheet2.jpg"&gt;page 2&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/345201392220129351-303462710008777370?l=unixfaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixfaq.blogspot.com/feeds/303462710008777370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=345201392220129351&amp;postID=303462710008777370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/303462710008777370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/303462710008777370'/><link rel='alternate' type='text/html' href='http://unixfaq.blogspot.com/2009/02/fundamental-unix-commands.html' title='Fundamental Unix Commands'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-345201392220129351.post-3652232763073247825</id><published>2008-10-15T04:35:00.000-07:00</published><updated>2008-12-23T00:12:05.690-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'> An Overview of the UNIX* Operating System</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="0" name="header"&gt;   &lt;w:lsdexception locked="false" priority="0" name="footer"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="0" name="page number"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="0" name="Body Text"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="0" name="Hyperlink"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="0" name="Normal (Web)"&gt;   &lt;w:lsdexception locked="false" priority="0" name="HTML Cite"&gt;   &lt;w:lsdexception locked="false" priority="0" name="HTML Preformatted"&gt;   &lt;w:lsdexception locked="false" priority="0" name="HTML Typewriter"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:"Times New Roman";} a:link, span.MsoHyperlink 	{mso-style-noshow:yes; 	mso-style-unhide:no; 	color:blue; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{mso-style-noshow:yes; 	mso-style-priority:99; 	color:purple; 	mso-themecolor:followedhyperlink; 	text-decoration:underline; 	text-underline:single;} strong 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-bidi-font-weight:normal;} p.H2, li.H2, div.H2 	{mso-style-name:H2; 	mso-style-unhide:no; 	mso-style-next:Normal; 	margin-top:5.0pt; 	margin-right:0in; 	margin-bottom:5.0pt; 	margin-left:0in; 	mso-pagination:widow-orphan; 	page-break-after:avoid; 	mso-outline-level:3; 	font-size:18.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:"Times New Roman"; 	layout-grid-mode:line; 	font-weight:bold; 	mso-bidi-font-weight:normal;} p.H3, li.H3, div.H3 	{mso-style-name:H3; 	mso-style-unhide:no; 	mso-style-next:Normal; 	margin-top:5.0pt; 	margin-right:0in; 	margin-bottom:5.0pt; 	margin-left:0in; 	mso-pagination:widow-orphan; 	page-break-after:avoid; 	mso-outline-level:4; 	font-size:14.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:"Times New Roman"; 	layout-grid-mode:line; 	font-weight:bold; 	mso-bidi-font-weight:normal;} p.H4, li.H4, div.H4 	{mso-style-name:H4; 	mso-style-unhide:no; 	mso-style-next:Normal; 	margin-top:5.0pt; 	margin-right:0in; 	margin-bottom:5.0pt; 	margin-left:0in; 	mso-pagination:widow-orphan; 	page-break-after:avoid; 	mso-outline-level:5; 	font-size:12.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:"Times New Roman"; 	layout-grid-mode:line; 	font-weight:bold; 	mso-bidi-font-weight:normal;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:1.0in; 	mso-footer-margin:1.0in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:-2; 	mso-list-type:simple; 	mso-list-template-ids:-1;} @list l0:level1 	{mso-level-start-at:0; 	mso-level-text:*; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	margin-left:0in; 	text-indent:0in;} @list l0:level1 lfo1 	{mso-level-number-format:bullet; 	mso-level-numbering:continue; 	mso-level-text:; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	mso-level-legacy:yes; 	mso-level-legacy-indent:.25in; 	mso-level-legacy-space:0in; 	text-indent:-.25in; 	font-family:Symbol;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif";} &lt;/style&gt; &lt;![endif]--&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;The UNIX&lt;span style=""&gt;&lt;b style=""&gt;Error! Hyperlink reference not valid.&lt;/b&gt;&lt;/span&gt; operating system was designed to let a number of programmers access the computer at the same time and share its resources.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The operating system coordinates the use of the computer's resources, allowing one person, for example, to run a spell check program while another creates a document, lets another edit a document while another creates graphics, and lets another user format a document -- all at the same time, with each user oblivious to the activities of the others.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The operating system controls all of the commands from all of the keyboards and all of the data being generated, and permits each user to believe he or she is the only person working on the computer.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This real-time sharing of resources make UNIX one of the most powerful operating systems ever.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Although UNIX was developed by programmers for programmers, it provides an environment so powerful and flexible that it is found in businesses, sciences, academia, and industry. Many telecommunications switches and transmission systems also are controlled by administration and maintenance systems based on UNIX.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;While initially designed for medium-sized minicomputers, the operating system was soon moved to larger, more powerful mainframe computers. As personal computers grew in popularity, versions of UNIX found their way into these boxes, and a number of companies produce UNIX-based machines for the scientific and programming communities.&lt;/p&gt;  &lt;p class="H3"&gt;The uniqueness of UNIX&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The features that made UNIX a hit from the start are:&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;Multitasking capability &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Multiuser capability &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Portability &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;UNIX programs &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Library of application      software &lt;/li&gt;&lt;/ul&gt;  &lt;p class="H4"&gt;Multitasking&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Many computers do just one thing at a time, as anyone who uses a PC or laptop can attest. Try logging onto your company's network while opening your browser while opening a word processing program. Chances are the processor will freeze for a few seconds while it sorts out the multiple instructions.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;UNIX, on the other hand, lets a computer do several things at once, such as printing out one file while the user edits another file. This is a major feature for users, since users don't have to wait for one application to end before starting another one.&lt;/p&gt;  &lt;p class="H4"&gt;Multiusers&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The same design that permits multitasking permits multiple users to use the computer. The computer can take the commands of a number of users -- determined by the design of the computer -- to run programs, access files, and print documents at the same time.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The computer can't tell the printer to print all the requests at once, but it does prioritize the requests to keep everything orderly. It also lets several users access the same document by compartmentalizing the document so that the changes of one user don't override the changes of another user.&lt;/p&gt;  &lt;p class="H4"&gt;System portability&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A major contribution of the UNIX system was its portability, permitting it to move from one brand of computer to another with a minimum of code changes. At a time when different computer lines of the same vendor didn't talk to each other -- yet alone machines of multiple vendors -- that meant a great savings in both hardware and software upgrades.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;It also meant that the operating system could be upgraded without having all the customer's data inputted again. And new versions of UNIX were backward compatible with older versions, making it easier for companies to upgrade in an orderly manner.&lt;/p&gt;  &lt;p class="H4"&gt;UNIX tools&lt;/p&gt;  &lt;p class="MsoNormal"&gt;UNIX comes with hundreds of programs that can divided into two classes:&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;strong&gt;Integral utilities&lt;/strong&gt;      that are absolutely necessary for the operation of the computer, such as      the command interpreter, and &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;strong&gt;Tools&lt;/strong&gt;      that aren't necessary for the operation of UNIX but provide the user with      additional capabilities, such as typesetting capabilities and e-mail. &lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;strong&gt;Tools can be added or removed from a UNIX system, depending upon the applications required.&lt;/strong&gt;&lt;/p&gt;  &lt;p class="H4"&gt;UNIX Communications&lt;/p&gt;  &lt;p class="MsoNormal"&gt;E-mail is commonplace today, but it has only come into its own in the business community within the last 10 years. Not so with UNIX users, who have been enjoying e-mail for several decades.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;UNIX e-mail at first permitted users on the same computer to communicate with each other via their terminals. Then users on different machines, even made by different vendors, were connected to support e-mail. And finally, UNIX systems around the world were linked into a world wide web decades before the development of today's World Wide Web.&lt;/p&gt;  &lt;p class="H4"&gt;Applications libraries&lt;/p&gt;  &lt;p class="MsoNormal"&gt;UNIX as it is known today didn't just develop overnight. Nor were just a few people responsible for it's growth. As soon as it moved from Bell Labs into the universities, every computer programmer worth his or her own salt started developing programs for UNIX.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Today there are hundreds of UNIX applications that can be purchased from third-party vendors, in addition to the applications that come with UNIX.&lt;/p&gt;  &lt;p class="H3"&gt;How UNIX is organized&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The UNIX system is functionally organized at three levels:&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;The kernel, which      schedules tasks and manages storage; &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;The shell, which connects      and interprets users' commands, calls programs from memory, and executes      them; and &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;The tools and applications      that offer additional functionality to the operating system &lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;strong&gt;The three levels of the UNIX system: kernel, shell, and tools and applications.&lt;/strong&gt;&lt;/p&gt;  &lt;p class="H4"&gt;The kernel&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The heart of the operating system, the kernel controls the hardware and turns part of the system on and off at the programer's command. If you ask the computer to list (&lt;i style=""&gt;ls&lt;/i&gt;) all the files in a directory, the kernel tells the computer to read all the files in that directory from the disk and display them on your screen.&lt;/p&gt;  &lt;p class="H4"&gt;The shell&lt;/p&gt;  &lt;p class="MsoNormal"&gt;There are several types of shell, most notably the command driven Bourne Shell and the C Shell (no pun intended), and menu-driven shells that make it easier for beginners to use. Whatever shell is used, its purpose remains the same -- to act as an interpreter between the user and the computer.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The shell also provides the functionality of "pipes," whereby a number of commands can be linked together by a user, permitting the output of one program to become the input to another program.&lt;/p&gt;  &lt;p class="H4"&gt;Tools and applications&lt;/p&gt;  &lt;p class="MsoNormal"&gt;There are hundreds of tools available to UNIX users, although some have been written by third party vendors for specific applications. Typically, tools are grouped into categories for certain functions, such as word processing, business applications, or programming.&lt;/p&gt;  &lt;p class="H3"&gt;References&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Want to know &lt;a href="file:///D:/My%20Docs%20From%20Cell/moreinfo.html"&gt;more about UNIX&lt;/a&gt;?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/345201392220129351-3652232763073247825?l=unixfaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixfaq.blogspot.com/feeds/3652232763073247825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=345201392220129351&amp;postID=3652232763073247825' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/3652232763073247825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/3652232763073247825'/><link rel='alternate' type='text/html' href='http://unixfaq.blogspot.com/2008/10/overview-of-unix-operating-system.html' title=' An Overview of the UNIX* Operating System'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-345201392220129351.post-8172836855144998610</id><published>2008-10-15T04:30:00.000-07:00</published><updated>2008-12-23T00:12:05.690-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>Unix File System</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="0" name="header"&gt;   &lt;w:lsdexception locked="false" priority="0" name="footer"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="0" name="page number"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="0" name="Body Text"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="0" name="Hyperlink"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="0" name="Normal (Web)"&gt;   &lt;w:lsdexception locked="false" priority="0" name="HTML Cite"&gt;   &lt;w:lsdexception locked="false" priority="0" name="HTML Preformatted"&gt;   &lt;w:lsdexception locked="false" priority="0" name="HTML Typewriter"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:"Times New Roman";} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif";} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;UNIX Unleashed, System Administrator's Edition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;- 18 -&lt;/p&gt;  &lt;p class="MsoNormal"&gt;File System and Disk Administration&lt;/p&gt;  &lt;p class="MsoNormal"&gt;By Steve Shah&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This chapter discusses the trials and tribulations of creating, maintaining, and repairing file systems. While these tasks may appear simple from a user's standpoint, they are, in fact, intricate and contain more than a handful of nuances . In the course of this chapter, we'll step through many of these nuances and, hopefully, come to a strong understanding of the hows and whys of file systems.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Before we really jump into the topic, you should have a good understanding of UNIX directories, files, permissions, and paths. These are the key building blocks in understanding how to administer your file systems, and I assume you already have a mastery of them. If the statement, "Be sure to have /usr/bin before /usr/local/bin in your $PATH" confuses you in any way, you should be reading something more fundamental first. Refer to Part I, "Introduction to UNIX," for some basic instructions in UNIX.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This chapter goes about the explanation of file systems a bit differently than other books. We first discuss the maintenance and repair of file systems, then discuss their creation. This was done because it is more likely that you already have existing file systems you need to maintain and fix. Understanding how to maintain them also helps you better understand why file systems are created the way they are.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The techniques we cover here are applicable to most UNIX systems currently in use. The only exceptions are when we actually create the file systems. This is where the most deviation from any standard (if there ever was one) occurs. We cover the creation of file systems under the SunOS, Solaris, Linux, and IRIX implementations of UNIX. If you are not using one of these operating systems, you should check the documentation that came with your operating system for details on the creation of file systems. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;CAUTION: Working with file systems is inherently dangerous. You may be surprised at how quickly and easily you can damage a file system beyond repair. In some instances, it is even possible to damage the disk drive as well. BE CAREFUL. When performing the actions explained in this chapter, be sure you have typed the commands in correctly and you understand the resulting function fully before executing it. When in doubt, consult the documentation that came from the manufacturer. Most importantly, the documentation that comes from the manufacturer is always more authoritative than any book. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;NOTE: You should read the entire chapter before actually performing any of the tasks below. This will give you a better understanding of how all the components work together, thereby giving you more solid ground when performing potentially dangerous activities. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What Is a File System&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The file system is the primary means of file storage in UNIX. Each file system houses directories, which, as a group, can be placed almost anywhere in the UNIX directory tree. The topmost level of the directory tree, the root directory, begins at /. Subdirectories nested below the root directory may traverse as deep as you like so long as the longest absolute path is less than 1,024 characters.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;With the proliferation of vendor-enhanced versions of UNIX, you will find a number of "enhanced" file systems. From the standpoint of the administrator, you shouldn't have to worry about the differences too much. The two instances where you will need to worry about vendor-specific details are in the creation of file systems and when performing backups. We will cover the specifics of: &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;SunOS 4.1.x, which uses 4.2 &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Solaris, which uses ufs &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Linux, which uses ext2 &lt;/p&gt;  &lt;p class="MsoNormal"&gt;IRIX, which uses efs and xfs &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Note that the ufs and 4.2 file systems are actually the same.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A file system, however, is only a part of the grand scheme of how UNIX keeps its data on disk. At the top level, you'll find the disks themselves. These disks are then broken into partitions, each varying in size depending on the needs of the administrator. It is on each partition that the actual file system is laid out. Within the file system, you'll find directories, subdirectories, and, finally, the individual files.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Although you will rarely have to deal with the file system at a level lower than the individual files stored on it, it is critical that you understand two key concepts: inodes and the superblock. Once you understand these, you will find that the behavior and characteristics of files make more sense. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;inodes&lt;/p&gt;  &lt;p class="MsoNormal"&gt;An inode maintains information about each file. Depending on the type of file system, the inode can contain upwards of 40+ pieces of information. Most of it, however, is only useful to the kernel and doesn't concern us. The fields that do concern us are&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;mode The permission mask and type of file. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;link count The number of directories that contain an entry with this inode number. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;user ID The ID of the file's owner. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;group ID The ID of the file's group. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;size Number of bytes in this file. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;access time The time at which the file was last accessed. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;mod time The time at which the file was last modified. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;inode time The time at which this inode structure was last modified. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;block list A list of disk block numbers which contain the first segment of the file. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;indirect list A list of other block lists. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The mode, link count, user ID, group ID, size, and access time are used when generating file listings. Note that the inode does not contain the file's name. That information is held in the directory file (see below for details). &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Superblocks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This is the most vital information stored on the disk. It contains information on the disk's geometry (number of heads, cylinders, and so on), the head of the inode list, and free block list. Because of its importance, the system automatically keeps mirrors of this data scattered around the disk for redundancy. You only have to deal with superblocks if your file system becomes heavily corrupted. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Types of Files&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Files come in 8 flavors: &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Normal Files &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Directories &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Hard Links &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Symbolic links &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sockets &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Named Pipes &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Character Devices &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Block Devices &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Normal Files These are the files you use the most. They can be either text or binary files; however, their internal structure is irrelevant from a System Administrator standpoint. A file's characteristics are specified by the inode in the file system that describes it. An ls -l on a normal file will look something like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;-rw-------&lt;span style=""&gt;    &lt;/span&gt;1 sshah&lt;span style=""&gt;    &lt;/span&gt;admin&lt;span style=""&gt;         &lt;/span&gt;42 May 12 13:09 hello&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Directories These are a special kind of file that contains a list of other files. Although there is a one-to-one mapping of inode to disk blocks, there can be a many-to-one mapping from directory entry to inode. When viewing a directory listing using the ls -l command, you can identify directories by their permissions starting with the d character. An ls -l on a directory looks something like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;drwx------&lt;span style=""&gt;    &lt;/span&gt;2 sshah&lt;span style=""&gt;    &lt;/span&gt;admin&lt;span style=""&gt;        &lt;/span&gt;512 May 12 13:08 public_html&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Hard Links&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A hard link is actually a normal directory entry except instead of pointing to a unique file , it points to an already existing file . This gives the illusion that there are two identical files when you do a directory listing. Because the system sees this as just another file, it treats it as such. This is most apparent during backups because hard-linked files get backed up as many times as there are hard links to them. Because a hard link shares an inode, it cannot exist across file systems. Hard links are created with the ln command. For example, given this directory listing using ls -l, we see:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;-rw-------&lt;span style=""&gt;    &lt;/span&gt;1 sshah&lt;span style=""&gt;    &lt;/span&gt;admin&lt;span style=""&gt;         &lt;/span&gt;42 May 12 13:04 hello&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;When you type ln hello goodbye and then perform another directory listing using ls -l, you see:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;-rw-------&lt;span style=""&gt;    &lt;/span&gt;2 sshah&lt;span style=""&gt;    &lt;/span&gt;admin&lt;span style=""&gt;         &lt;/span&gt;42 May 12 13:04 goodbye&lt;/p&gt;  &lt;p class="MsoNormal"&gt;-rw-------&lt;span style=""&gt;    &lt;/span&gt;2 sshah&lt;span style=""&gt;    &lt;/span&gt;admin&lt;span style=""&gt;         &lt;/span&gt;42 May 12 13:04 hello&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Notice how this appears to be two separate files that just happen to have the same file lengths. Also note that the link count (second column) has increased from one to two. How can you tell they actually are the same file? Use ls -il. Observe:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;13180 -rw-------&lt;span style=""&gt;    &lt;/span&gt;2 sshah&lt;span style=""&gt;    &lt;/span&gt;admin&lt;span style=""&gt;         &lt;/span&gt;42 May 12 13:04 goodbye&lt;/p&gt;  &lt;p class="MsoNormal"&gt;13180 -rw-------&lt;span style=""&gt;    &lt;/span&gt;2 sshah&lt;span style=""&gt;    &lt;/span&gt;admin&lt;span style=""&gt;         &lt;/span&gt;42 May 12 13:04 hello&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;You can see that both point to the same inode, 13180. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;WARNING: Be careful when creating hardlinks, especially when hardlinking to a directory. It is possible to corrupt a filesystem by doing so since the hardlink does not contain the fact that the i-node being pointed to needs to be treated as a directory. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Symbolic Links&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A symbolic link (sometimes referred to as a symlink) differs from a hard link because it doesn't point to another inode but to another filename. This allows symbolic links to exist across file systems as well as be recognized as a special file to the operating system. You will find symbolic links to be crucial to the administration of your file systems, especially when trying to give the appearance of a seamless system when there isn't one. Symbolic links are created using the ln -s command. A common thing people do is create a symbolic link to a directory that has moved. For example, if you are accustomed to accessing the directory for your home page in the subdirectory www but at the new site you work at, home pages are kept in the public_html directory, you can create a symbolic link from www to public_html using the command ln -s public_html www. Performing an ls -l on the result shows the link.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;drwx------&lt;span style=""&gt;    &lt;/span&gt;2 sshah&lt;span style=""&gt;    &lt;/span&gt;admin&lt;span style=""&gt;        &lt;/span&gt;512 May 12 13:08 public_html&lt;/p&gt;  &lt;p class="MsoNormal"&gt;lrwx------&lt;span style=""&gt;    &lt;/span&gt;1 sshah&lt;span style=""&gt;    &lt;/span&gt;admin&lt;span style=""&gt;         &lt;/span&gt;11 May 12 13:08 www -&gt; public_html&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sockets&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sockets are the means for UNIX to network with other machines. Typically, this is done using network ports; however, the file system has a provision to allow for interprocess communication through socket files. (A popular program that uses this technique is the X Windows system.) You rarely have to deal with this kind of file and should never have to create it yourself (unless you're writing the program). If you need to remove a socket file, use the rm command. Socket files are identified by their permission settings beginning with an s character. An ls -l on a socket file looks something like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;srwxrwxrwx&lt;span style=""&gt;   &lt;/span&gt;1 root&lt;span style=""&gt;     &lt;/span&gt;admin&lt;span style=""&gt;           &lt;/span&gt;0 May 10 14:38 X0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Named Pipes&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Similar to sockets, named pipes enable programs to communicate with one another through the file system. You can use the mknod command to create a named pipe. Named pipes are recognizable by their permissions settings beginning with the p character. An ls -l on a named pipe looks something like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;prw-------&lt;span style=""&gt;   &lt;/span&gt;1 sshah&lt;span style=""&gt;    &lt;/span&gt;admin&lt;span style=""&gt;           &lt;/span&gt;0 May 12 22:02 mypipe&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Character Devices&lt;/p&gt;  &lt;p class="MsoNormal"&gt;These special files are typically found in the /dev directory and provide a mechanism for communicating with system device drivers through the file system one character at a time. They are easily noticed by their permission bits starting with the c character. Each character file contains two special numbers, the major and minor. These two numbers identify which device driver that file communicates with. An ls -l on a character device looks something like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;crw-rw-rw-&lt;span style=""&gt;   &lt;/span&gt;1 root&lt;span style=""&gt;     &lt;/span&gt;wheel&lt;span style=""&gt;     &lt;/span&gt;21,&lt;span style=""&gt;   &lt;/span&gt;4 May 12 13:40 ptyp4&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Block Devices&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Block devices also share many characteristics with character devices in that they exist in the /dev directory, are used to communicate with device drivers, and have major and minor numbers. The key difference is that block devices typically transfer large blocks of data at a time versus one character at a time. (A hard disk is a block device, whereas a terminal is a character device.) Block devices are identified by their permission bits starting with the b character. An ls -l on a block device looks something like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;brw-------&lt;span style=""&gt;   &lt;/span&gt;2 root&lt;span style=""&gt;     &lt;/span&gt;staff&lt;span style=""&gt;     &lt;/span&gt;16,&lt;span style=""&gt;   &lt;/span&gt;2 Jul 29&lt;span style=""&gt;  &lt;/span&gt;1992 fd0c&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Managing File Systems&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Managing file systems is relatively easy. That is, once you can commit to memory the location of all the key files in the directory tree on each major variation of UNIX as well as your own layout of file systems across the networkÉ&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In other words, it can be a royal pain.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;From a technical standpoint there isn't much to deal with. Once the file systems have been put in their correct places and the boot time configuration files have been edited so that your file systems automatically come online at every start up, there isn't much to do besides watch your disk space.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;From a management standpoint, it's much more involved. Often you'll need to deal with existing configurations, which may not have been done "the right way," or you're dealing with site politics such as, "I won't let that department share my disks." Then you'll need to deal with users who don't understand why they need to periodically clean up their home directories. Don't forget the ever exciting vendor-specific nuisances and their idea of how the system "should be" organized.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This section covers the tools you need to manage the technical issues. Unfortunately, managerial issues are something that can't be covered in a book. Each site has different needs as well as different resources, resulting in different policies. If your site lacks any written policy, take the initiative to write one yourself. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Mounting and Unmounting File Systems&lt;/p&gt;  &lt;p class="MsoNormal"&gt;As I mentioned earlier in this chapter, part of the power in UNIX stems from its flexibility in placing file systems anywhere in the directory tree. This feat is accomplished by mounting file systems.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Before you can mount a file system, you need to select a mount point. A mount point is the directory entry in the file system where the root directory of a different file system will overlay it. UNIX keeps track of mount points, and accesses the correct file system, depending on which directory the user is currently in. A mount point may exist anywhere in the directory tree. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;NOTE: While it is technically true that you can mount a file system anywhere in the directory tree, there is one place you will NOT want to mount it: the root directory. Remember that once a file system is mounted at a directory, that directory is overshadowed by the contents of the mounted file system. Hence, by mounting on the root directory, the system will no longer be able to see its own kernel or local configuration files. How long your system goes on before crashing depends on your vendor.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;There is an exception to the rule. Some installation packages will mount a network file system to the root directory. This is done to give the installation software access to many packages that may not be able to fit on your boot disk. Unless you fully understand how to do this yourself, don't. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Mounting and Unmounting File Systems Manually To mount a file system, use the mount command:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;mount /dev/device /directory/to/mount&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where /dev/device is the device name you want to mount and /directory/to/mount is the directory you want to overlay in your local file system. For example, if you wanted to mount /dev/hda4 to the /usr directory, you would type:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;mount /dev/hda4 /usr&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Remember that the directory must exist in your local file system before anything can be mounted there.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;There are options that can be passed to the mount command. The most important characteristics are specified in the -o option. These characteristics are:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;rw&lt;span style=""&gt;        &lt;/span&gt;read/write&lt;/p&gt;  &lt;p class="MsoNormal"&gt;ro&lt;span style=""&gt;        &lt;/span&gt;read only&lt;/p&gt;  &lt;p class="MsoNormal"&gt;bg&lt;span style=""&gt;        &lt;/span&gt;background mount (if the mount fails,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;          &lt;/span&gt;place the process into the background&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;and keep trying until success.)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;intr&lt;span style=""&gt;      &lt;/span&gt;interruptible mount (if a process is&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;          &lt;/span&gt;pending I/O on a mounted partition, it&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;          &lt;/span&gt;will allow the process to be interrupted&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;          &lt;/span&gt;and the I/O call dropped)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;An example of these parameters being used is:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;mount -o rw,bg,intr /dev/hda4 /usr&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;See the man page on your system for vendor specific additions.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To unmount a file system, use the umount command. For example:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;umount /usr&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This unmounts the /usr file system from the current directory tree, unveiling the original directory underneath it.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;There is, of course, a caveat. If users are using files on a mounted file system, you cannot unmount it. All files must be closed before this can happen, which on a large system can be tricky to say the least. There are three ways to handle this: &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Use the lsof program (available at ftp://vic.cc.purdue.edu/pub/tools/unix/lsof) to list the users and their open files on a given file system. Then either wait until they are done, beg them to leave, or kill their processes off. Then unmount the file system. Often, this isn't very desirable. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Use the -f option with umount command to force the unmount. This is often a bad idea because it leaves the programs (and users) accessing the partition confused. Files which are in memory that have not been committed to disk may be lost. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Bring the system to single user mode, then unmount the file system. While the largest inconvenience, it is the safest way because no one loses any work. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Mounting File Systems Automatically At boot time, the system automatically mounts the root file system with read-only privileges. This enables it to load the kernel and read critical startup files. However, once it has bootstrapped itself, it needs guidance. Although it is possible for you to mount all the file systems by hand, it isn't realistic because you would then have to finish bootstrapping the machine yourself, and worse, the system could not come back online by itself. (Unless, of course, you enjoy coming into work at 2 a.m. to bring a system back up.)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To get around this, UNIX uses a special file called /etc/fstab (/etc/vfstab under Solaris). This file lists all the partitions that need to be mounted at boot time and the directory where they need to be mounted. Along with that information you can pass parameters to the mount command.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Each file system to be mounted is listed in the fstab file in the following format:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/device&lt;span style=""&gt;    &lt;/span&gt;/dir/to/mount&lt;span style=""&gt;        &lt;/span&gt;ftype parameters fs_freq fs_passno&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/device Is the device to be mounted, for instance, /dev/hda4. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dir/to/mount Is the location at which the file system should be mounted on your directory tree. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;ftype Is the file system type. This should be 4.2 under SunOS, ufs under Solaris, ext2 under Linux, efs or xfs in IRIX (depending on your version), nfs for NFS mounted file systems, swap for swap partitions, and proc for the /proc file system. Some operating systems, such as Linux, support additional filesystem types, although they are not as likely to be used. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;parameters Are the parameters we passed to mount using the -o option. They follow the same comma-delineated format. An example entry would look like rw,intr,bg. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;fs_freq Is used by dump to determine whether a file system needs to be dumped. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;fs_passno Is used by the fsck program to determine the order to check disks at boot time. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Any lines in the fstab file that start with the pound symbol (#) are considered comments.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If you need to mount a new file system while the machine is live, you must perform the mount by hand. If you wish to have this mount automatically active the next time the system is rebooted, you should be sure to add the appropriate entry to your fstab file.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;There are two notable partitions that don't follow the same set of rules as normal partitions. They are the swap partition and /proc. (Note that SunOS does not use the /proc file system.)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Mounting the swap partition is not done using the mount command. It is instead managed by the swap command under Solaris and IRIX, and by the swapon command under SunOS and Linux. In order for a swap partition to be mounted, it must be listed in the appropriate fstab file. Once it's there, use the appropriate command (swap or swapon) with the -a parameter followed by the partition on which you've allocated swap space.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The /proc file system is even stranger because it really isn't a file system. It is an interface to the kernel abstracted into a file system style format. This should be listed in your fstab file with file system type proc. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;TIP: If you need to remount a file system that already has an entry in the fstab file, you don't need to type in the mount command with all the parameters. Instead, simply pass the directory to mount as a parameter like this: &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;mount /dir/to/mount &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;mount automatically looks to the fstab file for all the details, such as which partition to mount and which options to use.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If you need to remount a large number of file systems that are already listed in the fstab file (in other words, you need to remount directories from a system that has gone down), you can use the -a option in the mount command to try and remount all the entries in the fstab file like this: &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;mount -a &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If mount finds that a file system is already mounted, no action is performed on that file system. If, on the other hand, mount finds that an entry is not mounted, it automatically mounts it with the appropriate parameters. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Here is a complete fstab file from a SunOS systems:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;#&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# Sample /etc/fstab file for a SunOS machine&lt;/p&gt;  &lt;p class="MsoNormal"&gt;#&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# Local mounts&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/sd0a&lt;span style=""&gt;            &lt;/span&gt;/&lt;span style=""&gt;        &lt;/span&gt;4.2&lt;span style=""&gt;    &lt;/span&gt;rw&lt;span style=""&gt;        &lt;/span&gt;1 1&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/sd0g&lt;span style=""&gt;            &lt;/span&gt;/usr&lt;span style=""&gt;        &lt;/span&gt;4.2&lt;span style=""&gt;    &lt;/span&gt;rw&lt;span style=""&gt;        &lt;/span&gt;1 2&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/sd0b&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;swap&lt;span style=""&gt;        &lt;/span&gt;swap&lt;span style=""&gt;    &lt;/span&gt;rw&lt;span style=""&gt;        &lt;/span&gt;0 0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/sd0d&lt;span style=""&gt;            &lt;/span&gt;/var&lt;span style=""&gt;        &lt;/span&gt;4.2&lt;span style=""&gt;    &lt;/span&gt;rw&lt;span style=""&gt;        &lt;/span&gt;0 0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# Remote mounts&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;server1:/export/home&lt;span style=""&gt;        &lt;/span&gt;/home&lt;span style=""&gt;        &lt;/span&gt;nfs&lt;span style=""&gt;    &lt;/span&gt;rw,bg,intr&lt;span style=""&gt;    &lt;/span&gt;0 0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;server1:/export/usr/local&lt;span style=""&gt;    &lt;/span&gt;/usr/local&lt;span style=""&gt;    &lt;/span&gt;nfs&lt;span style=""&gt;    &lt;/span&gt;rw,bg,intr&lt;span style=""&gt;    &lt;/span&gt;0 0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;server2:/export/var/spool/mail&lt;span style=""&gt;    &lt;/span&gt;/var/spool/mail&lt;span style=""&gt;    &lt;/span&gt;nfs&lt;span style=""&gt;    &lt;/span&gt;rw,bg,intr&lt;span style=""&gt;    &lt;/span&gt;0 0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Common Commands for File System Management&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In taking care of your system, you'll quickly find that you can use these commands and many of their parameters without having to look them up. This is because you're going to be using them all the time. I highly suggest you learn to love them. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;NOTE: In reading this book you may have noticed the terms program and command are used interchangably. This is because there are no "built in" commands to the system, each one is invoked as an individual program. However, you will quickly find that both the people who use UNIX, as well as UNIX related texts (such as this one), use the both terms to mean the same thing. Confusing? A bit. But it's tough to change 25+ years of history. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;NOTE: At the end of each command description, I mention the GNU equivalent. Linux users shouldn't worry about getting them, because Linux ships with all GNU tools. If you are using another platform and aren't sure whether you're using the GNU version, try running the command with the --version option. If it is GNU, it will display its title and version number. If it isn't GNU, it'll most likely reject the parameter and give an error. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;df The df command summarizes the free disk space by file system. Running it without any parameters displays all the information about normally mounted and NFS mounted file systems. The output varies from vendor to vendor (under Solaris, use df -t) but should closely resemble this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Filesystem&lt;span style=""&gt;         &lt;/span&gt;1024-blocks&lt;span style=""&gt;  &lt;/span&gt;Used Available Capacity Mounted on&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/hda3&lt;span style=""&gt;             &lt;/span&gt;247871&lt;span style=""&gt;  &lt;/span&gt;212909&lt;span style=""&gt;    &lt;/span&gt;22161&lt;span style=""&gt;     &lt;/span&gt;91%&lt;span style=""&gt;   &lt;/span&gt;/&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/hda6&lt;span style=""&gt;              &lt;/span&gt;50717&lt;span style=""&gt;   &lt;/span&gt;15507&lt;span style=""&gt;    &lt;/span&gt;32591&lt;span style=""&gt;     &lt;/span&gt;32%&lt;span style=""&gt;   &lt;/span&gt;/var&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/hda7&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;        &lt;/span&gt;481998&lt;span style=""&gt;      &lt;/span&gt;15&lt;span style=""&gt;   &lt;/span&gt;457087&lt;span style=""&gt;      &lt;/span&gt;0%&lt;span style=""&gt;   &lt;/span&gt;/local&lt;/p&gt;  &lt;p class="MsoNormal"&gt;server1:/var/spool/mail&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                      &lt;/span&gt;489702&lt;span style=""&gt;  &lt;/span&gt;222422&lt;span style=""&gt;   &lt;/span&gt;218310&lt;span style=""&gt;     &lt;/span&gt;50%&lt;span style=""&gt;   &lt;/span&gt;/var/spool/mail&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The columns reported show: Filesystem Which file system is being shown. File systems mounted using NFS are shown as hostname:/dir/that/is/mounted &lt;/p&gt;  &lt;p class="MsoNormal"&gt;1024-blocks The number of 1 KB blocks the file system consists of. (Its total size.) &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Used The number of blocks used. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Available The number of blocks available for use. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Capacity Percentage of partition currently used. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Mounted on The location in the directory tree this partition has been mounted on. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Common parameters to this command are:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;directory Show information only for the partition on which the specified directory exists. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;-a Show all partitions including swap and /proc. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;-i Show inode usage instead of block usage. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The GNU df program, which is part of the fileutils distribution, has some additional print formatting features you may find useful. You can download the latest fileutils package at ftp://ftp.cdrom.com/pub/gnu.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;du The du command summarizes disk usage by directory. It recurses through all subdirectories and shows disk usage by each subdirectory with a final total at the end. Running it without any parameters shows the usage like so:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;409&lt;span style=""&gt;     &lt;/span&gt;./doc&lt;/p&gt;  &lt;p class="MsoNormal"&gt;945&lt;span style=""&gt;     &lt;/span&gt;./lib&lt;/p&gt;  &lt;p class="MsoNormal"&gt;68&lt;span style=""&gt;      &lt;/span&gt;./man&lt;/p&gt;  &lt;p class="MsoNormal"&gt;60&lt;span style=""&gt;      &lt;/span&gt;./m4&lt;/p&gt;  &lt;p class="MsoNormal"&gt;391&lt;span style=""&gt;     &lt;/span&gt;./src&lt;/p&gt;  &lt;p class="MsoNormal"&gt;141&lt;span style=""&gt;     &lt;/span&gt;./intl&lt;/p&gt;  &lt;p class="MsoNormal"&gt;873&lt;span style=""&gt;     &lt;/span&gt;./po&lt;/p&gt;  &lt;p class="MsoNormal"&gt;3402&lt;span style=""&gt;    &lt;/span&gt;.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The first column shows the blocks of disk used by the subdirectory, and the second column shows the subdirectory being evaluated. To see how many kilobytes each subdirectory consumes, use the -k option. Some common parameters to this command are&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;directory Show usage for the specified directory. The default is the current directory. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;-a Show usage for all files, not just directories. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;-s Show only the total disk usage. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Like the df program, this program is available as part of the GNU fileutils distribution. The GNU version has expanded on many of the parameters which you may find useful. The fileutils package can be downloaded from ftp://ftp.cdrom.com/pub/gnu.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;ln The ln program is used to generate links between files. This is very useful for creating the illusion of a perfect file system in which everything is in the "right" place when, in reality, it isn't. This is done by making a link from the desired location to the actual location.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The usage of this program is&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;ln file_being_linked_to link_name&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where file_being_linked_to is the file that already exists, and you wish to have another file point to it called link_name. The command above generates a hard link, meaning that the file link_name will be indistinguishable from the original file. Both files must exist on the same file system.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A popular parameter to ln is the -s option, which generates symbolic links instead of hard links. The format of the command remains the same:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;ln -s file_being_linked_to link_name&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;the difference being that the link_name file is marked as a symbolic link in the file system. Symbolic links may span file systems and are given a special tag in the directory entry. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;TIP: Unless there is an explicit reason not to, you should always use symbolic links by specifying the -s option to ln. This makes your links stand out and makes it easy to move them from one file system to another. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;tar The tar program is an immensely useful archiving utility. It can combine an entire directory tree into one large file suitable for transferring or compression.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The command line format of this program is:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;tar parameters filelist&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Common parameters are:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;c Create an archive &lt;/p&gt;  &lt;p class="MsoNormal"&gt;x Extract the archive &lt;/p&gt;  &lt;p class="MsoNormal"&gt;v Be verbose &lt;/p&gt;  &lt;p class="MsoNormal"&gt;f Specify a tar file to work on &lt;/p&gt;  &lt;p class="MsoNormal"&gt;p Retain file permissions and ownerships &lt;/p&gt;  &lt;p class="MsoNormal"&gt;t View the contents of an archive. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Unlike most other UNIX commands, the parameters do not need to have a dash before them.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To create the tarfile myCode.tar, I could use tar in the following manners:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;tar cf myCode.tar myCode&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where myCode is a subdirectory relative to the current directory where the files I wish to archive are located.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;tar cvf myCode.tar myCode&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Same as the previous tar invocation, although this time it lists all the files added to the archive on the screen.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;tar cf myCode.tar myCode/*.c&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This archives all the files in the myCode directory that are suffixed by .c&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;tar cf myCode.tar myCode/*.c myCode/*.h&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This archives all the files in the myCode directory that are suffixed by .c or .h&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To view the contents of the myCode.tar file, use:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;tar tf myCode.tar&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To extract the files in the myCode.tar file, use:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;tar xf myCode.tar&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If the myCode directory doesn't exist, tar creates it. If the myCode directory does exist, any files in that directory are overwritten by the ones being untarred.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;tar xvf myCode.tar&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Same as the previous invocation of tar, but this lists the files as they are being extracted.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;tar xpf myCode.tar&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Same as the previous invocation of tar, but this attempts to set the permissions of the unarchived files to the values they had before archiving (very useful if you're untarring files as root). &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;TIP: The greatest use of tar for Systems Administrators is to move directory trees around. This can be done using the following set of commands: &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;(cd /src;tar cf - *) | (cd /dest;tar xpf -) &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where /src is the source directory and /dest is the destination directory.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This is better than using a recursive copy because symbolic links and file permissions are kept. Use this and amaze your friends. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;While the stock tar that comes with your system works fine for most uses, you may find that the GNU version of tar has some nicer features. You can find the latest version of GNU tar at ftp://ftp.cdrom.com/pub/gnu.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;find Of the commands that I've mentioned so far, you're likely to use find the most. Its purpose is to find files or patterns of files. The parameters for this tool are&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;find dir parameters&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where dir is the directory where the search begins, and parameters define what is being searched for. The most common parameters you will use are:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;-name Specify the filename or wildcards to look for. If you use any wildcards, be sure to place them inside of quotes so that the shell doesn't parse them before find does. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;-print Typically turned on by default, it tells find to display the resulting file list. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;-exec Executes the specified command on files found matching the -name criteria. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;-atime n File was last accessed n days ago. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;-mtime n File's data was last modified n days ago. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;-size n[bckw] File uses n units of space where the units are specified by either b,c,k, or w. b is for 512 byte blocks, c is bytes, k is kilobytes, and w is two-byte words. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;-xdev Do not traverse down nonlocal file systems. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;-o Logical or the options. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;-a Logical and the options. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Some examples of the find command are&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;find / -name core -mtime +7 -print -exec /bin/rm {} \;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This starts its search from the root directory and finds all files named core that have not been modified in seven days.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;find / -xdev -atime +60 -a -mtime +60 -print&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This searches all files, from the root directory down, on the local file system, which have not been accessed for at least 60 days and have not been modified for at least 60 days, and prints the list. This is useful for finding those files that people claim they need but, in reality, never use.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;find /home -size +500k -print&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This searches all files from /home down and lists them if they are greater than 500 KB in size. A handy way of finding large files in the system.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The GNU version of find, which comes with the findutils package, offers many additional features you will find useful. You can download the latest version from ftp://ftp.cdrom.com/pub/gnu. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Repairing File Systems with fsck&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sooner or later, it happens: Someone turns off the power switch. The power outage lasts longer than your UPS's batteries and you didn't shut down the system. Someone presses the reset button. Someone overwrites part of your disk. A critical sector on the disk develops a flaw. If you run UNIX long enough, eventually a halt occurs where the system did not write the remaining cached information (sync'ed) to the disks.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;When this happens, you need to verify the integrity of each of the file systems. This is necessary because if the structure is not correct, using the file systems could quickly damage them beyond repair. Over the years, UNIX has developed a very sophisticated file system integrity check that can usually recover the problem. It's called fsck. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The fsck Utility&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The fsck utility takes its understanding of the internals of the various UNIX file systems and attempts to verify that all the links and blocks are correctly tied together. It runs in five passes, each of which checks a different part of the linkage and each of which builds on the verifications and corrections of the prior passes.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fsck walks the file system, starting with the superblock. It then deals with the allocated disk blocks, pathnames, directory connectivity, link reference counts, and the free list of blocks and inodes. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;NOTE: The xfs filesystem now shipped with all IRIX based machines no longer need the fsck command. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The Superblock Every change to the file system affects the superblock, which is why it is cached in RAM. Periodically, at the sync interval, it is written to disk. If it is corrupted, fsck checks and corrects it. If it is so badly corrupted that fsck cannot do its work, find the paper you saved when you built the file system and use the -b option with fsck to give it an alternate superblock to use. The superblock is the head of each of the lists that make up the file system, and it maintains counts of free blocks and inodes.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Inodes fsck validates each of the inodes. It makes sure that each block in the block allocation list is not on the block allocation list in any other inode, that the size is correct, and that the link count is correct. If the inodes are correct, then the data is accessible. All that's left is to verify the pathnames. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What Is a Clean (Stable) File System?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Sometimes fsck responds&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;/opt: stable&lt;span style=""&gt;                        &lt;/span&gt;(ufs file systems)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This means that the superblock is marked clean and that no changes have been made to the file system since it was marked clean. First, the system marks the superblock as dirty; then it starts modifying the rest of the file system. When the buffer cache is empty and all pending writes are complete, it goes back and marks the superblock as clean. If the superblock is marked clean, there is normally no reason to run fsck, so unless fsck is told to ignore the clean flag, it just prints this notice and skips over this file system. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Where Is fsck?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;When you run fsck, you are running an executable in either the /usr/sbin or /bin directory called fsck, but this is not the real fsck. It is just a dispatcher that invokes a file system type-specific fsck utility. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;When Should I Run fsck?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Normally, you do not have to run fsck. The system runs it automatically when you try to mount a file system at boot time that is dirty. However, problems can creep up on you. Software and hardware glitches do occur from time to time. It wouldn't hurt to run fsck just after performing the monthly backups. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;CAUTION: It is better to run fsck after the backups rather than before. If fsck finds major problems, it could leave the file system in worse shape than it was prior to running. Then you can just build an empty file system and reread your backup, which also cleans up the file system. If you did it in the other order, you would be left with no backup and no file system. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;How Do I Run fsck?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Because the system normally runs it for you, running fsck is not an everyday occurrence for you to remember. However, it is quite simple and mostly automatic.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;First, to run fsck, the file system you intend to check must not be mounted. This is a bit hard to do if you are in multiuser mode most of the time, so to run a full system fsck you should bring the system down to single user mode.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In single user mode you need to invoke fsck, giving it the options to force a check of all file systems, even if they are already stable.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;fsck -f&lt;span style=""&gt;             &lt;/span&gt;(SunOS)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;fsck -o f&lt;span style=""&gt;           &lt;/span&gt;(Solaris)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;fsck&lt;span style=""&gt;                &lt;/span&gt;(Linux and IRIX)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If you wish to check a single specific file system, type its character device name. (If you aren't sure what the device name is, see the section on adding a disk to the system for details on how to determine this information.) For example:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fsck /dev/hda1&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Stepping Through an Actual fsck fsck occurs in five to seven steps, depending on your operating system and what errors are found, if any. fsck can automatically correct most of these errors and does so if invoked at boot time to automatically check a dirty file system.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The fsck we are about to step through was done on a ufs file system. While there are some differences between the numbering of the phases for different file systems, the errors are mostly the same, requiring the same solutions. Apply common sense liberally to any invocation of fsck and you should be okay.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Checking ufs File Systems For ufs file systems, fsck is a five-phase process. fsck can automatically correct most of these errors and does so if invoked at boot time to automatically check a dirty file system. However, when you run fsck manually, you are asked to answer the questions that the system would automatically answer. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;CAUTION: Serious errors reported by the ufs fsck at the very beginning, especially before reporting the sta8rt of phase 1, indicate an invalid superblock. fsck should be terminated and restarted with the -b option specifying one of the alternate superblocks. Block 32 is always an alternate and can be tried first, but if the front of the file system was overwritten, it too may be damaged. Use the hard copy you saved from the mkfs to find an alternate later in the file system. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Phase 1: Check Blocks and Sizes This phase checks the inode list, looking for invalid inode entries. Errors requiring answers include&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;UNKNOWN FILE TYPE I=inode number (CLEAR)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The file type bits are invalid in the inode. Options are to leave the problem and attempt to recover the data by hand later or to erase the entry and its data by clearing the inode.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;PARTIALLY TRUNCATED INODE I=inode number (SALVAGE)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The inode appears to point to less data than the file does. This is safely salvaged, because it indicates a crash while truncating the file to shorten it.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;block BAD I=inode number&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;block DUP I=inode number&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The disk block pointed to by the inode is either out of range for this inode or already in use by another file. This is an informational message. If a duplicate block is found, phase 1b is run to report the inode number of the file that originally used this block.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Phase 2: Check Pathnames This phase removes directory entries from bad inodes found in phase 1 and 1b and checks for directories with inode pointers that are out of range or pointing to bad inodes. You may have to handle&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;ROOT INODE NOT DIRECTORY (FIX?)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;You can convert inode 2, the root directory, back into a directory, but this usually means there is major damage to the inode table.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;I=OUT OF RANGE I=inode number NAME=file name (REMOVE?)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;UNALLOCATED I=inode number OWNER=O MODE=M SIZE=S MTIME=T TYPE=F&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;(REMOVE?)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;BAD/DUP I=inode number OWNER=O MODE=M SIZE=S MTIME=T TYPE=F (REMOVE?)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A bad inode number was found, an unallocated inode was used in a directory, or an inode that had a bad or duplicate block number in it is referenced. You are given the choice to remove the file, losing the data, or to leave the error. If you leave the error, the file system is still damaged, but you have the chance to try to dump the file first and salvage part of the data before rerunning fsck to remove the entry.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fsck may return one of a variety of errors indicating an invalid directory length. You will be given the chance to have fsck fix or remove the directory as appropriate. These errors are all correctable with little chance of subsequent damage.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Phase 3: Check Connectivity This phase detects errors in unreferenced directories. It creates or expands the lost+found directory if needed and connects the misplaced directory entries into the lost+found directory. fsck prints status messages for all directories placed in lost+found.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Phase 4: Check Reference Counts This phase uses the information from phases 2 and 3 to check for unreferenced files and incorrect link counts on files, directories, or special files.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;UNREF FILE I=inode number OWNER=O MODE=M SIZE=S MTIME=T (RECONNECT?)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The filename is not known (it is an unreferenced file), so it is reconnected into the lost+found directory with the inode number as its name. If you clear the file, its contents are lost. Unreferenced files that are empty are cleared automatically.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;LINK COUNT FILE I=inode number OWNER=O MODE=M SIZE=S MTIME=T COUNT=X&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;(ADJUST?)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;LINK COUNT DIR I=inode number OWNER=O MODE=M SIZE=S MTIME=T COUNT=X&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;(ADJUST?)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In both cases, an entry was found with a different number of references than what was listed in the inode. You should let fsck adjust the count.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;BAD/DUP FILE I=inode number OWNER=O MODE=M SIZE=S MTIME=T (CLEAR)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A file or directory has a bad or duplicate block in it. If you clear it now, the data is lost. You can leave the error and attempt to recover the data, and rerun fsck later to clear the file.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Phase 5: Check Cylinder Groups This phase checks the free block and unused inode maps. It automatically corrects the free lists if necessary, although in manual mode it asks permission first. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What Do I Do After fsck Finishes?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;First, relax, because fsck rarely finds anything seriously wrong, except in cases of hardware failure where the disk drive is failing or where you copied something on top of the file system. UNIX file systems are very robust.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;However, if fsck finds major problems or makes a large number of corrections, rerun it to be sure the disk isn't undergoing hardware failure. It shouldn't find more errors in a second run. Then, recover any files that it may have deleted. If you keep a log of the inodes it clears, you can go to a backup tape and dump the list of inodes on the tape. Recover just those inodes to restore the files.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Back up the system again, because there is no reason to have to do this all over again. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Dealing with What Is in lost+found&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If fsck reconnects unreferenced entries, it places them in the lost+found directory. They are safe there, and the system should be backed up in case you lose them while trying to move them back to where they belong. Items in lost+found can be of any type: files, directories, special files (devices), and so on. If it is a named pipe or socket, you may as well delete it. The process which opened it is long since gone and will open a new one when it is run again.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;For files, use the owner name to contact the user and have him look at the contents and see if the file is worth keeping. Often, it is a file that was deleted and is no longer needed, but the system crashed before it could be fully removed.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;For directories, the files in the directory should help you and the owner determine where they belong. You can look on the backup tape lists for a directory with those contents if necessary. Then just remake the directory and move the files back. Then remove the directory entry in lost+found. This re-creation and move has the added benefit of cleaning up the directory. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Creating File Systems&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now that you understand the nuances of maintaining a file system, it's time to understand how they are created. This section walks you through the three steps of: &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Picking the right kind of disk for your system &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Creating partitions &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Creating the file system &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Disk Types&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Although there are many different kinds of disks, UNIX systems have come to standardize on SCSI for workstations. Many PCs also sport SCSI interfaces, but because of the lower cost and abundance, you'll find a lot of IDE drives on UNIX PC's as well.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;SCSI itself comes in a few different flavors now. There is regular SCSI, SCSI-2, SCSI-Wide, SCSI-Fast and Wide, and now SCSI-3. Although it is possible to mix and match these devices with converter cables, you may find it both easier on your sanity and your performance if you stick to one format. As of this writing, SCSI-2 is the most common interface.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;When attaching your SCSI drive, there are many important points to remember. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Terminate your SCSI chain. Forgetting to do this causes all sorts of non-deterministic behavior (a pain to track down). SCSI-2 requires active termination, which is usually indicated by terminators with LEDs on them. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If a device claims to be self-terminating, you can take your chances, but you'll be less likely to encounter an error if you put a terminator on anyway. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;There is a limit of eight devices on a SCSI chain with the SCSI card counting as a device. Some systems may have internal SCSI devices, so be sure to check for those. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Be sure all your devices have unique SCSI IDs. A common symptom of having two devices with the same ID is their tendency to frequently reset the SCSI chain. Of course, many devices simply won't work under those conditions. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;When adding or removing a SCSI disk, be sure to power the system down first. There is power running through the SCSI cables, and failing to shut them down first may lead to problems in the future. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Although SCSI is king of the workstation, PCs have another choice: IDE. IDE tends to be cheaper and more available than SCSI devices with many motherboards offering direct IDE support. The advantage of using this kind of interface is its availability as well as lower cost. They are also simpler and require less configuration on your part.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The down side to IDEs is that their simplicity comes at the cost of configurability and expandability. The IDE chain can only hold two devices, and not all motherboards come with more than one IDE chain. If your CD-ROM is IDE, you only have space for one disk. This is probably okay with a single person workstation, but as you can imagine, it's not going to fly well in a server environment. Another consideration is speed. SCSI was designed with the ability to perform I/O without the aid of the main CPU, which is one of the reasons it costs more. IDE, on the other hand, was designed with cost in mind. This resulted in a simplified controller; hence, the CPU takes the burden for working the drive.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;While IDE did manage to simplify the PC arena, it did come with the limitation of being unable to handle disks greater than 540M. Various tricks were devised to circumvent this, however, the clean solution is now predominantly available. Known as EIDE (Enhanced IDE), it is capable of supporting disks up to 8G and can support up to 4 devices on one chain.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In weighing the pros and cons of EIDE versus SCSI in the PC environment, don't forget to think about the cost-to-benefit ratio. Having a high speed SCSI controller in a single person's workstation may not be as necessary as the user is convinced it is. Plus, with disks being released in 2+ gigabyte configurations, there is ample room on the typical IDE disk.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Once you have decided on the disk subsystem to install, read the documentation that came with the machine for instructions on physically attaching the disk to the system. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;What Are Partitions and Why Do I Need Them?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Partitions are UNIX's way of dividing the disk into usable pieces. UNIX requires that there be at least one partition; however, you'll find that creating multiple partitions, each with a specific function, is often necessary.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The most visible reason for creating separate partitions is to protect the system from the users. The one required partition mentioned earlier is called the root partition. It is here that critical system software and configuration files (the kernel and mount tables) must reside. This partition must be carefully watched so that it never fills up. If it fills up, your system may not be able to come back up in the event of a system crash. Because the root partition is not meant to hold the users' data, you must create separate partitions for the users' home directories, temporarily files, and so forth. This enables their files to grow without the worry of crowding out the key system files.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Dual boot configurations are becoming another common reason to partition, especially with the ever-growing popularity of Linux. You may find your users wanting to be able to boot to either Windows or Linux; therefore, you need to keep at least two partitions to enable them to do this.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The last, but certainly not least, reason to partition your disks is the issue of backups. Backup software often works by dumping entire partitions onto tape. By keeping the different types of data on separate partitions, you can be explicit about what gets backed up and what doesn't. For example, daily backup of the system software isn't necessary, but backups of home directories are. By keeping the two on separate partitions, you can be more concise in your selection of what gets backed up and what doesn't.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Another example relates more to company politics. It may be possible that one group does not want their data to be backed up to the same tape as another group's. (Note: common sense doesn't always apply to inter-group politicsÉ) By keeping the two groups on separate partitions, you can exclude one from your normal backups and exclude the others during your special backups.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Which Partitions To Create As I mentioned earlier, the purpose of creating partitions is to separate the users from the system areas. So how many different partitions need to be created? While there is no right answer for every installation, here are some guidelines to take into account.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;You always need a root partition. In this partition, you'll have your /bin, /etc, and /sbin directories at the very least. Depending on your version of UNIX, this could require anywhere from 30 to 100 megabytes. /tmp The /tmp directory is where your users, as well as programs, store temporarily files. The usage of this directory can quickly get out of hand, especially if you run a quota-based site. By keeping it a separate partition, you do not need to worry about its abuse interfering with the rest of the system. Many operating systems automatically clear the contents of /tmp on boot. Size /tmp to fit your site's needs. If you use quotas, you will want to make it a little larger, whereas sites without quotas may not need as much space. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;Under Solaris, you have another option when setting up /tmp. Using the tmpfs filesystem, you can have your swap space and /tmp partition share the same physical location on disk. While it appears to be an interesting idea, you'll quickly find that it isn't a very good solution, especially on a busy system. This is because as more users do their work, more of /tmp will be used. Of course, if there are more users, there is a greater memory requirement to hold them all. The competition for free space can become very problematic. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;/var The /var directory is where the system places its spool files (print spool, incoming/outgoing mail queue, and so on) as well as system log files. Because of this, these files constantly grow and shrink with no warning. Especially the mail spool. Another possibility to keep in mind is the creation of a separate partition just for mail. This enables you to export the mail spool to all of your machines without having to worry about your print spools being exported as well. If you use a backup package that requires its own spool space, you may wish to keep this a separate partition as well. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;/home The /home directory is where you place your users' account directories. You may need to use multiple partitions to keep your home directories (possibly broken up by department) and have each partition mount to /home/dept where dept is the name of the respective department. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;/usr The /usr directory holds noncritical system software, such as editors and lesser used utilities. Many sites hold locally compiled software in the /usr/local directory where they either export it to other machines, or mount other machines' /usr/local to their own. This makes it easy for a site to maintain one /usr/local directory and share it amongst all of its machines. Keeping this a separate partition is a good idea since local software inevitably grows. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;swap This isn't a partition you actually keep files on, but it is key to your system's performance. The swap partition should be allocated and swapped to instead of using swap files on your normal file system. This enables you to contain all of your swap space in one area that is out of your way. A good guideline for determining how much swap space to use is to double the amount of RAM installed on your system. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;TIP: Several new versions of UNIX are now placing locally compiled software in the /opt directory. Like /usr/local, this should be made a separate partition as well. If your system does not use /opt by default, you should make a symbolic link from there to /usr/local. The vice versa is true as well, if your system uses /opt, you should create a symbolic link from /usr/local to /opt.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To add to the confusion, the Redhat Distribution of Linux has brought the practice of installing precompiled software (RPMs) in the /usr/bin directory. If you are using Redhat, you may want to make your /usr directory larger since locally installed packages will consume that partition. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The Device Entry&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Most implementations of UNIX automatically create the correct device entry when you boot it with the new drive attached. Once this entry has been created, you should check it for permissions. Only root should be given read/write access to it. If your backups run as a nonroot user, you may need to give group read access to the backup group. Be sure that no one else is in the backup group. Allowing world read/write access to the disk is the easiest way to have your system hacked, destroyed, or both.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Device entries under Linux IDE disks under Linux use the following scheme to name the hard disks:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/hd[drive][partition]&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Each IDE drive is lettered starting from a. So the primary disk on the first chain is a; the slave on the first chain is b; the primary on the secondary chain is c; and so on. Each disk's partition is referenced by number. For example, the third partition of the slave drive on the first chain is /dev/hdb3.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;SCSI disks use the same scheme except instead of using /dev/hd as the prefix, /dev/sd is used. So to refer to the second partition of the first disk on the SCSI chain, you would use /dev/sda2.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To refer to the entire disk, specify all the information except the partition. For example, to refer to the entire primary disk on the first IDE chain, you would use /dev/hda.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Device entries under IRIX SCSI disks under IRIX are referenced in either the /dev/dsk or /dev/rdsk directories. The following is the format:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/[r]dsk/dksCdSP&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where C is the controller number, S is the SCSI address, and P is the partition, s0,s1,s2, and so on. The partition name can also be vh for the volume header or vol to refer to the entire disk.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Device entries under Solaris The SCSI disks under Solaris are referenced in either the /dev/dsk or /dev/rdsk directories. The following is the format:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/[r]dsk/cCtSd0sP&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where C is the controller number, S is the SCSI address, and P is the partition number. Partition 2 always refers to the entire disk and label information. Partition 1 is typically used for swap.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Device entries under SunOS Disks under SunOS are referenced in the /dev directory. The following is the format:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/sdTP&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where T is the target number and P is the partition. Typically, the root partition is a, the swap partition is b, and the entire disk is referred to as partition c. You can have partitions from a through f.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;An important aspect to note is an oddity with the SCSI target and unit numbering: Devices that are target three need to be called target zero, and devices that are target zero need to be called target three. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A Note About Formatting Disks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;"Back in the old days," disks needed to be formatted and checked for bad blocks. The procedure of formatting entailed writing the head, track, and sector numbers in a sector preamble and a checksum in the postamble to every sector on the disk. At the same time, any sectors that were unusable due to flaws in the disk surface were marked and, depending on the type of disk, an alternate sector mapped into its place.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Thankfully, we have moved on.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Both SCSI and IDE disks now come pre-formatted from the factory. Even better, they transparently handle bad blocks on the disk and remap them without any assistance from the operating system. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;CAUTION: You should NEVER attempt to low level format an IDE disk.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Doing so will make your day very bad as you watch the drive quietly kill itself. Be prepared to throw the disk away should you feel the need to low level format it. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Partitioning Disks and Creating File Systems&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In this section, we will cover the step by step procedure for partitioning disks under Linux, IRIX, SunOS, and Solaris. Since the principles are similar across all platforms, each platform will also cover another method of determining how a disk should be partitioned up depending on its intended usage.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Linux To demonstrate how partitions are created under Linux, we will setup a disk with a single user workstation in mind. It will need not only space for system software, but for application software and the user's home directories.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Creating Partitions For this example, we'll create the partitions on a 1.6 GB IDE disk located on /dev/hda. This disk will become the boot device for a single user workstation. We will create the boot /usr, /var, /tmp, /home, and swap partitions.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;During the actual partitioning, we don't name the partitions. Where the partitions are mounted is specified with the /etc/fstab file. Should we choose to mount them in different locations later on, we could very well do that. However, by keeping the function of each partition in mind, we have a better idea of how to size them.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A key thing to remember with the Linux fdisk command is that it does not commit any changes made to the partition table to disk until you explicitly do so with the w command.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;With the drive installed, we begin by running the fdisk command:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# fdisk /dev/hda&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This brings us to the fdisk command prompt. We start by using the p command to print what partitions are currently on the disk.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help): p&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Disk /dev/hda: 64 heads, 63 sectors, 786 cylinders&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Units = cylinders of 4032 * 512 bytes&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;Device Boot&lt;span style=""&gt;  &lt;/span&gt;Begin&lt;span style=""&gt;   &lt;/span&gt;Start&lt;span style=""&gt;     &lt;/span&gt;End&lt;span style=""&gt;  &lt;/span&gt;Blocks&lt;span style=""&gt;   &lt;/span&gt;Id&lt;span style=""&gt;  &lt;/span&gt;System&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We see that there are no partitions on the disk. With 1.6 GB of space, we can be very liberal with allocating space to each partition. Keeping this policy in mind, we begin creating our partitions with the n command:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help): n&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;      &lt;/span&gt;e&lt;span style=""&gt;   &lt;/span&gt;extended&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;      &lt;/span&gt;p&lt;span style=""&gt;   &lt;/span&gt;primary partition (1-4)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;p&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Partition number (1-4): 1&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;First cylinder (1-786): 1&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Last cylinder or +size or +sizeM or +sizeK ([1]-786): +50M&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The 50 MB partition we just created becomes our root partition. Because it is the first partition, it is referred to as /dev/hda1. Using the p command, we see our new partition:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help): p&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Disk /dev/hda: 64 heads, 63 sectors, 786 cylinders&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Units = cylinders of 4032 * 512 bytes&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;Device Boot&lt;span style=""&gt;  &lt;/span&gt;Begin&lt;span style=""&gt;   &lt;/span&gt;Start&lt;span style=""&gt;     &lt;/span&gt;End&lt;span style=""&gt;  &lt;/span&gt;Blocks&lt;span style=""&gt;   &lt;/span&gt;Id&lt;span style=""&gt;  &lt;/span&gt;System&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;/dev/hda1&lt;span style=""&gt;           &lt;/span&gt;1&lt;span style=""&gt;       &lt;/span&gt;1&lt;span style=""&gt;      &lt;/span&gt;26&lt;span style=""&gt;   &lt;/span&gt;52384+&lt;span style=""&gt;  &lt;/span&gt;83&lt;span style=""&gt;  &lt;/span&gt;Linux native&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;With the root partition out of the way, we will create the swap partition. Our sample machine has 32 MB of RAM and will be running X-Windows along with a host of development tools. It is unlikely that the machine will get a memory upgrade for a while, so we'll allocate 64 MB to swap.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;Command (m for help): n&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command action&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;e&lt;span style=""&gt;   &lt;/span&gt;extended&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;p&lt;span style=""&gt;   &lt;/span&gt;primary partition (1-4)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;p&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Partition number (1-4): 2&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;First cylinder (27-786): 27&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Last cylinder or +size or +sizeM or +sizeK ([27]-786): +64M&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Because this partition is going to be tagged as swap, we need to change its file system type to swap using the t command.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help): t&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Partition number (1-4): 2&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Hex code (type L to list codes): 82&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Changed system type of partition 2 to 82 (Linux swap)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Because of the nature of the user, we know that there will be a lot of local software installed on this machine. With that in mind, we'll create /usr with 500 MB of space.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help): n&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command action&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;e&lt;span style=""&gt;   &lt;/span&gt;extended&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;p&lt;span style=""&gt;   &lt;/span&gt;primary partition (1-4)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;p&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Partition number (1-4): 3&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;First cylinder (60-786): 60&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Last cylinder or +size or +sizeM or +sizeK ([60]-786): +500M&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If you've been keeping your eyes open, you've noticed that we can only have one more primary partition to use, but we want to have /home, /var, and /tmp to be in separate partitions. How do we do this?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Extended partitions.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The remainder of the disk is created as an extended partition. Within this partition, we can create more partitions for use. Let's create this extended partition:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help): n&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command action&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;e&lt;span style=""&gt;   &lt;/span&gt;extended&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;p&lt;span style=""&gt;   &lt;/span&gt;primary partition (1-4)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;e&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Partition number (1-4): 4&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;First cylinder (314-786): 314&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Last cylinder or +size or +sizeM or +sizeK ([314]-786): 786&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We can now create /home inside the extended partition. Our user is going to need a lot of space, so we'll create a 500 MB partition. Notice that we are no longer asked whether we want a primary or extended partition.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help): n&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;First cylinder (314-786): 314&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Last cylinder or +size or +sizeM or +sizeK ([314]-786): +500M&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Using the same pattern, we create a 250 MB /tmp and a 180 MB /var partition.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help): n&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;First cylinder (568-786): 568&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Last cylinder or +size or +sizeM or +sizeK ([568]-786): +250M&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help): n&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;First cylinder (695-786): 695&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Last cylinder or +size or +sizeM or +sizeK ([695]-786): 786&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Notice on the last partition we created that I did not specify a size, but instead specified the last track. This is to ensure that all of the disk is used.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Using the p command, we look at our final work:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help): p&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Disk /dev/hda: 64 heads, 63 sectors, 786 cylinders&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Units = cylinders of 4032 * 512 bytes&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;Device Boot&lt;span style=""&gt;  &lt;/span&gt;Begin&lt;span style=""&gt;   &lt;/span&gt;Start&lt;span style=""&gt;     &lt;/span&gt;End&lt;span style=""&gt;  &lt;/span&gt;Blocks&lt;span style=""&gt;   &lt;/span&gt;Id&lt;span style=""&gt;  &lt;/span&gt;System&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;/dev/hda1&lt;span style=""&gt;           &lt;/span&gt;1&lt;span style=""&gt;       &lt;/span&gt;1&lt;span style=""&gt;      &lt;/span&gt;26&lt;span style=""&gt;   &lt;/span&gt;52384+&lt;span style=""&gt;  &lt;/span&gt;83 &lt;span style=""&gt; &lt;/span&gt;Linux native&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;/dev/hda2&lt;span style=""&gt;          &lt;/span&gt;27&lt;span style=""&gt;      &lt;/span&gt;27&lt;span style=""&gt;      &lt;/span&gt;59&lt;span style=""&gt;   &lt;/span&gt;66528&lt;span style=""&gt;   &lt;/span&gt;82&lt;span style=""&gt;  &lt;/span&gt;Linux swap&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;/dev/hda3&lt;span style=""&gt;          &lt;/span&gt;60&lt;span style=""&gt;      &lt;/span&gt;60&lt;span style=""&gt;     &lt;/span&gt;313&lt;span style=""&gt;  &lt;/span&gt;512064&lt;span style=""&gt;   &lt;/span&gt;83&lt;span style=""&gt;  &lt;/span&gt;Linux native&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;/dev/hda4&lt;span style=""&gt;         &lt;/span&gt;314&lt;span style=""&gt;     &lt;/span&gt;314&lt;span style=""&gt;     &lt;/span&gt;786&lt;span style=""&gt;  &lt;/span&gt;953568&lt;span style=""&gt;    &lt;/span&gt;5&lt;span style=""&gt;  &lt;/span&gt;Extended&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;/dev/hda5&lt;span style=""&gt;         &lt;/span&gt;314&lt;span style=""&gt;     &lt;/span&gt;314&lt;span style=""&gt;     &lt;/span&gt;567&lt;span style=""&gt;  &lt;/span&gt;512032+&lt;span style=""&gt;  &lt;/span&gt;83&lt;span style=""&gt;  &lt;/span&gt;Linux native&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;/dev/hda6&lt;span style=""&gt;         &lt;/span&gt;568&lt;span style=""&gt;     &lt;/span&gt;568&lt;span style=""&gt;     &lt;/span&gt;694&lt;span style=""&gt;  &lt;/span&gt;256000+&lt;span style=""&gt;  &lt;/span&gt;83&lt;span style=""&gt;  &lt;/span&gt;Linux native&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;/dev/hda7&lt;span style=""&gt;         &lt;/span&gt;695&lt;span style=""&gt;     &lt;/span&gt;695&lt;span style=""&gt;     &lt;/span&gt;786&lt;span style=""&gt;  &lt;/span&gt;185440+&lt;span style=""&gt;  &lt;/span&gt;83&lt;span style=""&gt;  &lt;/span&gt;Linux native&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Everything looks good. To commit this configuration to disk, we use the w command:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Command (m for help): w&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;The partition table has been altered!&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Calling ioctl() to re-read partition table.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;(Reboot to ensure the partition table has been updated.)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Syncing disks.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Reboot the machine to ensure that the partition has been updated and you're done creating the partitions.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Creating File Systems in Linux Creating a partition alone isn't very useful. In order to make it useful, we need to make a file system on top of it. Under Linux, this is done using the mke2fs command and the mkswap command.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To create the file system on the root partition, we use the following commands:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;mke2fs /dev/hda1&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The program only takes a few seconds to run and generates output similar to this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;mke2fs 0.5b, 14-Feb-95 for EXT2 FS 0.5a, 95/03/19&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;128016 inodes, 512032 blocks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;25601 blocks (5.00%) reserved for the super user&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;First data block=1&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Block size=1024 (log=0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Fragment size=1024 (log=0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;63 block groups&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;8192 blocks per group, 8192 fragments per group&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;2032 inodes per group&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Superblock backups stored on blocks:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;          &lt;/span&gt;8193,16385,24577,32769,40961,49153,57345,65537,73729,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;          &lt;/span&gt;81921,90113,98305,106497,114689,122881,131073,139265,147457,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;          &lt;/span&gt;155649,163841,172033,180225,188417,196609,204801,212993,221185,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;          &lt;/span&gt;229377,237569,245761,253953,262145,270337,278529,286721,294913,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;          &lt;/span&gt;303105,311297,319489,327681,335873,344065,352257,360449,368641,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;          &lt;/span&gt;376833,385025,393217,401409,409601,417793,425985,434177,442369,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;450561,458753,466945,475137,483329,491521,499713,507905&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;Writing inode tables: done&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Writing superblocks and file system accounting information: done &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;You should make a note of these superblock backups and keep them in a safe place. Should the day arise that you need to use fsck to fix a superblock gone bad, you will want to know where the backups are.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Simply do this for all of the partitions, except for the swap partition.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To create the swap file system, you need to use the mkswap command like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;mkswap /dev/hda2&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Replace /dev/hda2 with the partition you chose to make your swap space.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The result of the command will be similar to:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Setting up swapspace, size = 35090432 bytes&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;And the swap space is ready.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To make the root file system bootable, you need to install the lilo boot manager. This is part of all the standard Linux distributions, so you shouldn't need to hunt for it on the Internet.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Simply modify the /etc/lilo.conf file so that /dev/hda1 is set to be the boot disk and run:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;lilo&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The resulting output should look something like:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Added linux *&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where linux is the name of the kernel to boot, as specified by the name= field in /etc/lilo.conf.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;SunOS In this example, we will be preparting a Seagate ST32550N as an auxiliary disk to an existing system. The disk will be divided into three partitions: one for use as a mail spool, one for use as a /usr/local, and the third as an additional swap partition.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Creating the partitions &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;CAUTION: The procedure for formatting disks is not the same for SunOS and Solaris. Read each section to note the differences. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Once a disk has been attached to the machine, you should verify its connection and SCSI address by running the probe-scsi command from the PROM monitor if the disk is attached to the internal chain, or the probe-scsi-all command to see all the SCSI devices on the system. When you are sure the drive is properly attached and verified to be functioning, you're ready to start accessing the drive from the OS.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;After the machine has booted, run the dmesg command to collect the system diagnostic messages. You may want to pipe the output to grep so that you can easily find the information on disks. For example:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;dmesg | grep sd&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;On our system this generated the following output:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;sd0: &lt;sun0207&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;sd1 at esp0 target 1 lun 0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;sd1:&lt;span style=""&gt;    &lt;/span&gt;corrupt label - wrong magic number&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;sd1: Vendor 'SEAGATE', product 'ST32550N', 4194058 512 byte blocks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;root on sd0a fstype 4.2&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;swap on sd0b fstype spec size 32724K&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;dump on sd0b fstype spec size 32712K&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This result tells us that we have an installed disk on sd0 that the system is aware of and using. The information from the sd1 device is telling us that it found a disk, but it isn't usable because of a corrupt label. Don't worry about the error. Until we partition the disk and create file systems on it, the system doesn't know what to do with it, hence the error.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If you are using SCSI address 0 or 3, remember the oddity we mentioned earlier where device 0 needs to be referenced as 3 and device 3 needs to be referenced as 0.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Even though we do not have to actually format the disk, we do need to use the format program that come with SunOS because it also creates the partitions and writes the label to the disk.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To invoke the format program, simply run:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;format sd1&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where sd1 is the name of the disk we are going to partition.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The format program displays the following menu:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;FORMAT MENU:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;disk&lt;span style=""&gt;       &lt;/span&gt;- select a disk&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;type&lt;span style=""&gt;       &lt;/span&gt;- select (define) a disk type&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;partition&lt;span style=""&gt;  &lt;/span&gt;- select (define) a partition table&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;current&lt;span style=""&gt;    &lt;/span&gt;- describe the current disk&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;format&lt;span style=""&gt;     &lt;/span&gt;- format and analyze the disk&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;repair&lt;span style=""&gt;     &lt;/span&gt;- repair a defective sector&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;show&lt;span style=""&gt;       &lt;/span&gt;- translate a disk address&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;label&lt;span style=""&gt;      &lt;/span&gt;- write label to the disk&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span style=""&gt;              &lt;/span&gt;analyze&lt;span style=""&gt;    &lt;/span&gt;- surface analysis&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;defect&lt;span style=""&gt;     &lt;/span&gt;- defect list management&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;backup&lt;span style=""&gt;     &lt;/span&gt;- search for backup labels&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;quit&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;format&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We need to enter type at the format&gt; prompt so that we can tell SunOS the kind of disk we have. The resulting menu looks something like:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;AVAILABLE DRIVE TYPES:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;0. Quantum ProDrive 80S&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;1. Quantum ProDrive 105S&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;2. CDC Wren IV 94171-344&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;3. SUN0104&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;...&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;13. other&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;Specify disk type (enter its number):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Because we are adding a disk this machine has not seen before, we need to select option 13, other. This begins a series of prompts requesting the disk's geometry. Be sure to have this information from the manufacturer before starting this procedure.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The first question, Enter number of data cylinders: is actually a three-part question. After you enter the number of data cylinders, the program asks for the number of alternative cylinders and then the number of physical cylinders. The number of physical cylinders is the number your manufacturer provided you. Subtract two from there to get the number of data cylinders, and then just use the default value of 2 for the number of alternate cylinders. For our Seagate disk, we answered the questions as follows:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter number of data cylinders: 3508&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;Enter number of alternate cylinders [2]: 2&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;Enter number of physical cylinders [3510]: 3510&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;Enter number of heads: 11&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;Enter number of data sectors/track: 108&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;Enter rpm of drive [3600]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;Enter disk type name (remember quotes): "SEAGATE ST32550N"&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;selecting sd1: &lt;seagate&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;[disk formatted, no defect list found]&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;No defined partition tables.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Note that even though our sample drive actually rotates at 7200 rpm, we stick with the default of 3600 rpm because the software will not accept entering a higher speed. Thankfully, this doesn't matter because the operating system doesn't use the information.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Even though format reported that the disk was formatted, it really wasn't. It only acquired information needed to later write the label.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now we are ready to begin preparations to partition the disk.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;These preparations entail computing the amount each cylinder holds and then approximating the number of cylinders we want in each partition.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;With our sample disk, we know that each cylinder is composed of 108 sectors on a track, with 11 tracks composing the cylinder.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;From the information we saw in dmesg, we know that each block is 512 bytes long. Hence, if we want our mail partition to be 1 GB in size, we perform the following math to compute the necessary blocks:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;1 gigabyte = 1048576 kilobytes&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;One cylinder = 108 sectors * 11 heads = 1188 blocks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;1188 blocks = 594 kilobytes&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;1048576 / 594 = 1765 cylinders&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;1765 * 1188 = 2096820 blocks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Obviously, there are some rounding errors since the exact one GB mark occurs in the middle of a cylinder and we need to keep each partition on a cylinder boundary. 1,765 cylinders is more than close enough. The 1,765 cylinders translates to 2,096,820 blocks.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The new swap partition we want to make needs to be 64 MB in size. Using the same math as before, we find that our swap needs to be 130,680 blocks long. The last partition on the disk needs to fill the remainder of the disk. Knowing that we have a 2 GB disk, a 1 GB mail spool, and a 64 MB swap partition, this should leave us with about 960 MB for /usr/local.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Armed with this information, we are ready to tackle the partitioning. From the format&gt; prompt, type partition to start the partitioning menu. The resulting screen looks something like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;format&gt; partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;PARTITION MENU:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;a&lt;span style=""&gt;      &lt;/span&gt;- change 'a' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;b&lt;span style=""&gt;      &lt;/span&gt;- change 'b' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;c&lt;span style=""&gt;      &lt;/span&gt;- change 'c' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;d&lt;span style=""&gt;      &lt;/span&gt;- change 'd' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;e&lt;span style=""&gt;      &lt;/span&gt;- change 'e' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;f&lt;span style=""&gt;      &lt;/span&gt;- change 'f' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;g&lt;span style=""&gt;      &lt;/span&gt;- change 'g' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;h&lt;span style=""&gt;      &lt;/span&gt;- change 'h' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;select - select a predefined table&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;name&lt;span style=""&gt;   &lt;/span&gt;- name the current table&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;print&lt;span style=""&gt;  &lt;/span&gt;- display the current table&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;label&lt;span style=""&gt;  &lt;/span&gt;- write partition map and label to the disk&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;quit&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To create our mail partition, we begin by changing partition a. At the partition&gt; prompt, type a.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt; a&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This brings up a prompt for entering the starting cylinder and the number of blocks to allocate. Because this is going to be the first partition on the disk, we start at cylinder 0. Based on the math we did earlier, we know that we need 2,096,820 blocks.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;partition a - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;Enter new starting cyl [0]: 0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;Enter new # blocks [0, 0/0/0]: 2096820&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;partition&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now we want to create the b partition, which is traditionally used for swap space. We know how many blocks to use based on our calculations, but we don't know which cylinder to start from.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To solve this, we simply display the current partition information for the entire disk using the p command:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt; p&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Current partition table (unnamed):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition a - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;  &lt;/span&gt;2096820 (1765/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition b - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition c - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition d - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition e - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition f - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition g - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition h - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We can see that partition a is allocated with 2,096,820 blocks and is 1,765 cylinders long. Because we don't want to waste space on the disk, we start the swap partition on cylinder 1765.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;(Remember to count from zero!)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt; b&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition b - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter new starting cyl [0]: 1765&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter new # blocks [0, 0/0/0]: 130680&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Before we create our last partition, we need to take care of some tradition first, namely partition c. This is usually the partition that spans the entire disk. Before creating this partition, we need to do a little math.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;108 cylinders x 11 heads x 3508 data cylinders = 4167504 blocks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Notice that the number of blocks we compute here does not match the number actually on the disk. This number was computed based on the information we entered when giving the disk type information.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;It is important that we remain consistent.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Since the c partition spans the entire disk, we specify the starting cylinder as 0. Creating this partition should look something like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt; c&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition c - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter new starting cyl [0]: 0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter new # blocks [0, 0/0/0]: 4167504&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We have only one partition left to create: /usr/local. Because we want to fill the remainder of the disk, we need to do one last bit of math to compute how many blocks are still free.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This is done by taking the size of partition c (the total disk) and subtracting the sizes of the existing partitions. For our example, this works out to be:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;4167504 - 2096820 - 130680 = 1940004 remaining blocks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now we need to find out which cylinder to start from.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To do so, we run the p command again:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt; p&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Current partition table (unnamed):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition a - starting cyl &lt;span style=""&gt;     &lt;/span&gt;0, # blocks&lt;span style=""&gt;  &lt;/span&gt;2096820 (1765/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition b - starting cyl&lt;span style=""&gt;   &lt;/span&gt;1765, # blocks&lt;span style=""&gt;   &lt;/span&gt;130680 (110/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition c - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;  &lt;/span&gt;4167504 (3508/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition d - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;partition e - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition f - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition g - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition h - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To figure out which cylinder to start from, we add the number of cylinders used so far. Remember not to add the cylinders from partition c since it encompasses the entire disk.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;1765 + 110 = 1875&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now that we know which cylinder to start from and how many blocks to make it, we create our last partition.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt; d&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition d - starting cyl&lt;span style=""&gt;      &lt;/span&gt;0, # blocks&lt;span style=""&gt;        &lt;/span&gt;0 (0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter new starting cyl [0]: 1875&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter new # blocks [0, 0/0/0]: 1940004&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Congratulations! You've made it through the ugly part. Before we can truly claim victory, we need to commit these changes to disk using the label command. When given the prompt, Ready to label disk, continue? simply answer y.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt; label&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Ready to label disk, continue? y&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To leave the format program, type quit at the partition&gt; prompt, and then quit again at the format&gt; prompt.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Creating File Systems Now comes the easy part. Simply run the newfs command on all the partitions we created except for the swap partition and the entire disk partition . Your output should look similar to this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# newfs sd1a&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/dev/rsd1a:&lt;span style=""&gt;     &lt;/span&gt;2096820 sectors in 1765 cylinders of 11 tracks, 108 sectors&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;1073.6MB in 111 cyl groups (16 c/g, 9.73MB/g, 4480 i/g)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;superblock backups (for fsck -b #) at:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;32, 19152, 38272, 57392, 76512, 95632, 114752, 133872, 152992,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;172112, 191232, 210352, 229472, 248592, 267712, 286832, 304160, 323280,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;342400, 361520, 380640, 399760, 418880, 438000, 457120, 476240, 495360,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;514480, 533600, 552720, 571840, 590960, 608288, 627408, 646528, 665648,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;684768, 703888, 723008, 742128, 761248, 780368, 799488, 818608, 837728,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;856848, 875968, 895088, 912416, 931536, 950656, 969776, 988896, 1008016,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;1027136, 1046256, 1065376, 1084496, 1103616, 1122736, 1141856, 1160976, 1180096,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;1199216, 1216544, 1235664, 1254784, 1273904, 1293024, 1312144, 1331264, 1350384,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;1369504, 1388624, 1407744, 1426864, 1445984, 1465104, 1484224, 1503344, 1520672,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;1539792, 1558912, 1578032, 1597152, 1616272, 1635392, 1654512, 1673632, 1692752,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;1711872, 1730992, 1750112, 1769232, 1788352, 1807472, 1824800, 1843920, 1863040,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;1882160, 1901280, 1920400, 1939520, 1958640, 1977760, 1996880, 2016000, 2035120,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;2054240, 2073360, 2092480,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Be sure to note the superblock backups. This is critical information when fsck discovers heavy corruption in your file system. Remember to add your new entries into /etc/fstab if you want them to automatically mount on boot.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If you created the first partition with the intention of making it bootable, you have a few more steps to go. First, mount the new file system to /mnt.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# mount /dev/sd1a /mnt&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Once the file system is mounted, you need to clone your existing boot partition using the dump command like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# cd /mnt&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# dump 0f - / | restore -rf -&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;With the root partition cloned, use the installboot command to make it bootable:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# /usr/kvm/mdec/installboot /mnt/boot /usr/kvm/mdec/bootsd /dev/rsd1a&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Be sure to test your work by rebooting and making sure everything mounts correctly. If you created a bootable partition, be sure you can boot from it now. Don't wait for a disaster to find out whether or not you did it right.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Solaris For this example, we are partitioning a disk that is destined to be a web server for an intranet. We need a minimal root partition, adequate swap, tmp, var, and usr space, and a really large partition, which we'll call /web. Because the web logs will remain on the /web partition, and there will be little or no user activity on the machine, /var and /tmp will be set to smaller values. /usr will be a little larger because it may be destined to house web development tools.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Creating partitions &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;TIP: In another wondrous effort on its part to be just a little different, Sun has decided to call partitions "slices." With the number of documents regarding the file system so vast, you'll find that not all of them have been updated to use this new term, so don't be confused by the mix of "slices" with "partitions"--they are both the same. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;--------------------------------------------------------------------------------&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Once a disk has been attached to the machine, you should verify its connection and SCSI address by running the probe-scsi command from the PROM monitor if the disk is attached to the internal SCSI chain, probe-scsi-all to list all the SCSI devices on the system Once this shows that the drive is properly attached and verified to be functioning, you're ready to start accessing the drive from the OS. Boot the machine and login as root.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In order to find the device name, we are going to use for this, we again use the dmesg command.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# dmesg | grep sd&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;...&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;sd1 at esp0: target 1 lun 0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;sd1 is /sbus@1,f8000000/esp@0,800000/sd@1,0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;WARNING: /sbus@1,f8000000/esp@0,800000/sd@1,0 (sd1):&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;      &lt;/span&gt;corrupt label - wrong magic number&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;      &lt;/span&gt;Vendor 'SEAGATE', product 'ST32550N', 4194058 512 byte blocks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;...&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;From this message, we see that our new disk is device /dev/[r]dsk/c0t1d0s2. The disk hasn't been set up for use on a Solaris machine before, which is why we received the corrupt label error.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If you recall the layout of Solaris device names, you'll remember that the last digit on the device name is the partition number. Noting that, we see that Solaris refers to the entire disk in partition 2, much the same way SunOS refers to the entire disk as partition c.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Before we can actually label and partition the disk, we need to create the device files. This is done with the drvconfig and disks commands. They should be invoked with no parameters:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# drvconfig ; disks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now that the kernel is aware of the disk, we are ready to run the format command to partition the disk.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# format /dev/rdsk/c0t1d0s2&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This brings up the format menu as follows:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;FORMAT MENU:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;       &lt;/span&gt;disk&lt;span style=""&gt;       &lt;/span&gt;- select a disk&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;type&lt;span style=""&gt;       &lt;/span&gt;- select (define) a disk type&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;partition&lt;span style=""&gt;  &lt;/span&gt;- select (define) a partition table&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;current&lt;span style=""&gt;    &lt;/span&gt;- describe the current disk&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;format&lt;span style=""&gt;     &lt;/span&gt;- format and analyze the disk&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;repair&lt;span style=""&gt;     &lt;/span&gt;- repair a defective sector&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;label&lt;span style=""&gt;      &lt;/span&gt;- write label to the disk&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;analyze&lt;span style=""&gt;    &lt;/span&gt;- surface analysis&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;defect&lt;span style=""&gt;     &lt;/span&gt;- defect list management&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;backup&lt;span style=""&gt;     &lt;/span&gt;- search for backup labels&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;verify&lt;span style=""&gt;     &lt;/span&gt;- read and display labels&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;save &lt;span style=""&gt;      &lt;/span&gt;- save new disk/partition definitions&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;inquiry&lt;span style=""&gt;    &lt;/span&gt;- show vendor, product and revision&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;volname&lt;span style=""&gt;    &lt;/span&gt;- set 8-character volume name&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;quit&lt;/p&gt;  &lt;p class="MsoNormal"&gt;format&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To help the format command with partitioning, we need to tell it the disk's geometry by invoking the type command at the format&gt; prompt. We will then be asked to select what kind of disk we have. Because this is the first time this system is seeing this disk, we need to select other. This should look something like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;format&gt; type&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;AVAILABLE DRIVE TYPES:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;0. Auto configure&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;1. Quantum ProDrive 80S&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;2. Quantum ProDrive 105S&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;3. CDC Wren IV 94171-344&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;. . .&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;       &lt;/span&gt;16. other&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Specify disk type (enter its number): 16&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The system now prompts for the number of data cylinders. This is two less than the number of cylinders the vendor specifies because Solaris needs two cylinders for bad block mapping.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter number of data cylinders: 3508&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter number of alternate cylinders[2]: 2&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter number of physical cylinders[3510]: 3510&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The next question can be answered from the vendor specs as well.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter number of heads: 14&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The followup question about drive heads can be left as default.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter physical number of heads[default]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The last question you must answer can be pulled from the vendor specs as well.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter number of data sectors/track: 72&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The remaining questions should be left as default.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter number of physical sectors/track[default]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter rpm of drive[3600]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter format time[default]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter cylinder skew[default]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter track skew[default]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter tracks per zone[default]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter alternate tracks[default]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter alternate sectors[default]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter cache control[default]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter prefetch threshold[default]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter minimum prefetch[default]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter maximum prefetch[default]:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The last question you must answer about the disk is its label information. Enter the vendor name and model number in double quotes for this question. For our sample disk, this would be:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter disk type name (remember quotes): "SEAGATE ST32550N"&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;With this information, Solaris makes creating partitions easy. Dare I say, fun?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;After the last question from the type command, you will be placed at the format&gt; prompt. Enter partition to start the partition menu.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;format&gt;&lt;span style=""&gt;  &lt;/span&gt;partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;PARTITION MENU:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;0&lt;span style=""&gt;      &lt;/span&gt;- change '0' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;1&lt;span style=""&gt;      &lt;/span&gt;- change '1' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;2&lt;span style=""&gt;      &lt;/span&gt;- change '2' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;3&lt;span style=""&gt;      &lt;/span&gt;- change '3' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;4&lt;span style=""&gt;      &lt;/span&gt;- change '4' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;5&lt;span style=""&gt;      &lt;/span&gt;- change '5' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;6&lt;span style=""&gt;      &lt;/span&gt;- change '6' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;7&lt;span style=""&gt;      &lt;/span&gt;- change '7' partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;select - select a predefined table&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;modify - modify a predefined partition table&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;name&lt;span style=""&gt;   &lt;/span&gt;- name the current table&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;print&lt;span style=""&gt;  &lt;/span&gt;- display the current table&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;label&lt;span style=""&gt;  &lt;/span&gt;- write partition map and label to the disk&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;quit&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;At the partition&gt; prompt, enter modify to begin creating the new partitions. This brings up a question about what template to use for partitioning. We want the All Free Hog method.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;partition&gt; modify&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Select partitioning base:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;0. Current partition table (unnamed)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;1. All Free Hog&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Choose base (enter number)[0]? 1&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The All Free Hog method enables you to select one partition to receive the remainder of the disk once you have allocated a specific amount of space for the other partitions. For our example, the disk hog would be the /web partition because you want it to be as large as possible.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;As soon as you select option 1, you should see the following screen:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Part&lt;span style=""&gt;    &lt;/span&gt;Tag&lt;span style=""&gt;        &lt;/span&gt;Flag&lt;span style=""&gt;    &lt;/span&gt;Cylinders&lt;span style=""&gt;    &lt;/span&gt;Size&lt;span style=""&gt;    &lt;/span&gt;Blocks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;0&lt;span style=""&gt;    &lt;/span&gt;root&lt;span style=""&gt;        &lt;/span&gt;wm&lt;span style=""&gt;       &lt;/span&gt;0&lt;span style=""&gt;         &lt;/span&gt;0&lt;span style=""&gt;    &lt;/span&gt;(0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;1&lt;span style=""&gt;    &lt;/span&gt;swap&lt;span style=""&gt;        &lt;/span&gt;wu&lt;span style=""&gt;       &lt;/span&gt;0&lt;span style=""&gt;         &lt;/span&gt;0&lt;span style=""&gt;    &lt;/span&gt;(0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;2&lt;span style=""&gt;    &lt;/span&gt;backup&lt;span style=""&gt;        &lt;/span&gt;wu&lt;span style=""&gt;    &lt;/span&gt;0 - 3507&lt;span style=""&gt;    &lt;/span&gt;1.99GB&lt;span style=""&gt;    &lt;/span&gt;(3508/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;3&lt;span style=""&gt;    &lt;/span&gt;unassigned&lt;span style=""&gt;    &lt;/span&gt;wm&lt;span style=""&gt;       &lt;/span&gt;0&lt;span style=""&gt;             &lt;/span&gt;0&lt;span style=""&gt;    &lt;/span&gt;(0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;4&lt;span style=""&gt;    &lt;/span&gt;unassigned&lt;span style=""&gt;    &lt;/span&gt;wm&lt;span style=""&gt;       &lt;/span&gt;0&lt;span style=""&gt;         &lt;/span&gt;0&lt;span style=""&gt;    &lt;/span&gt;(0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;5&lt;span style=""&gt;    &lt;/span&gt;unassigned&lt;span style=""&gt;    &lt;/span&gt;wm&lt;span style=""&gt;       &lt;/span&gt;0&lt;span style=""&gt;         &lt;/span&gt;0&lt;span style=""&gt;    &lt;/span&gt;(0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;6&lt;span style=""&gt;    &lt;/span&gt;usr&lt;span style=""&gt;        &lt;/span&gt;wm&lt;span style=""&gt;       &lt;/span&gt;0&lt;span style=""&gt;         &lt;/span&gt;0&lt;span style=""&gt;    &lt;/span&gt;(0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;7&lt;span style=""&gt;    &lt;/span&gt;unassigned&lt;span style=""&gt;    &lt;/span&gt;wm&lt;span style=""&gt;       &lt;/span&gt;0&lt;span style=""&gt;         &lt;/span&gt;0&lt;span style=""&gt;    &lt;/span&gt;(0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Do you wish to continue creating a new partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;table based on above table [yes]? yes&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Because the partition table appears reasonable, agree to use it as a base for your scheme. You will now be asked which partition should be the Free Hog Partition, the one that receives whatever is left of the disk when everything else has been allocated.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;For our scheme, we'll make that partition number 5.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Free Hog Partition[6]? 5&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Answering this question starts the list of questions asking how large to make the other partitions. For our web server, we need a root partition to be about 200 MB for the system software, a swap partition to be 64 MB, a /tmp partition to be 200 MB, a /var partition to be 200 MB, and a /usr partition to be 400 MB. Keeping in mind that partition 2 has already been tagged as the "entire disk" and that partition 5 will receive the remainder of the disk, you will be prompted as follows:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter size of partition '0' [0b, 0c, 0.00mb]: 200mb&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter size of partition '1' [0b, 0c, 0.00mb]: 64mb&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter size of partition '3' [0b, 0c, 0.00mb]: 200mb&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter size of partition '4' [0b, 0c, 0.00mb]: 200mb&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter size of partition '6' [0b, 0c, 0.00mb]: 400mb&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter size of partition '7' [0b, 0c, 0.00mb]: 0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;As soon as you finish answering these questions, the final view of all the partitions appears looking something like:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Part&lt;span style=""&gt;   &lt;/span&gt;Tag&lt;span style=""&gt;          &lt;/span&gt;Flag&lt;span style=""&gt;    &lt;/span&gt;Cylinders&lt;span style=""&gt;     &lt;/span&gt;Size&lt;span style=""&gt;        &lt;/span&gt;Blocks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;0&lt;span style=""&gt;     &lt;/span&gt;root&lt;span style=""&gt;          &lt;/span&gt;wm&lt;span style=""&gt;     &lt;/span&gt;0 - 344&lt;span style=""&gt;       &lt;/span&gt;200.13mb&lt;span style=""&gt;    &lt;/span&gt;(345/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;1&lt;span style=""&gt;     &lt;/span&gt;swap&lt;span style=""&gt;          &lt;/span&gt;wu&lt;span style=""&gt;     &lt;/span&gt;345 - 455&lt;span style=""&gt;     &lt;/span&gt;64.39mb&lt;span style=""&gt;     &lt;/span&gt;(111/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;2&lt;span style=""&gt;     &lt;/span&gt;backup&lt;span style=""&gt;        &lt;/span&gt;wu&lt;span style=""&gt;     &lt;/span&gt;0 - 3507&lt;span style=""&gt;      &lt;/span&gt;1.99GB&lt;span style=""&gt;      &lt;/span&gt;(3508/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;3&lt;span style=""&gt;     &lt;/span&gt;unassigned&lt;span style=""&gt;    &lt;/span&gt;wm &lt;span style=""&gt;    &lt;/span&gt;456 - 800&lt;span style=""&gt;     &lt;/span&gt;200.13mb&lt;span style=""&gt;    &lt;/span&gt;(345/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;4&lt;span style=""&gt;     &lt;/span&gt;unassigned&lt;span style=""&gt;    &lt;/span&gt;wm&lt;span style=""&gt;     &lt;/span&gt;801 - 1145&lt;span style=""&gt;    &lt;/span&gt;200.13mb&lt;span style=""&gt;    &lt;/span&gt;(345/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;5&lt;span style=""&gt;     &lt;/span&gt;unassigned&lt;span style=""&gt;    &lt;/span&gt;wm&lt;span style=""&gt;     &lt;/span&gt;1146 - 2817&lt;span style=""&gt;   &lt;/span&gt;969.89mb&lt;span style=""&gt;    &lt;/span&gt;(1672/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;6&lt;span style=""&gt;     &lt;/span&gt;unassigned&lt;span style=""&gt;    &lt;/span&gt;wm&lt;span style=""&gt;     &lt;/span&gt;2818 - 3507&lt;span style=""&gt;   &lt;/span&gt;400.25mb&lt;span style=""&gt;    &lt;/span&gt;(690/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;7&lt;span style=""&gt;     &lt;/span&gt;unassigned&lt;span style=""&gt;    &lt;/span&gt;wm&lt;span style=""&gt;        &lt;/span&gt;0&lt;span style=""&gt;          &lt;/span&gt;0&lt;span style=""&gt;           &lt;/span&gt;(0/0/0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This is followed by the question:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Okay to make this the correct partition table [yes]? yes&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Answer yes since the table appears reasonable. This brings up the question:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Enter table name (remember quotes): "SEAGATE ST32550N"&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Answer with a description of the disk you are using for this example. Remember to include the quote symbols when answering. Given all of this information, the system is ready to commit this to disk. As one last check, you will be asked:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Ready to label disk, continue? y&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;As you might imagine, we answer yes to the question and let it commit the changes to disk. You have now created partitions and can quit the program by entering quit at the partition&gt; prompt and again at the format&gt; prompt.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Creating file systems To create a file system, simply run:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# newfs /dev/c0t1d0s0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where /dev/c0t1d0s0 is the partition on which to create the file system. Be sure to create a file system on all the partitions except for partitions 2 and 3, the swap, and entire disk, respectively. Be sure to note the backup superblocks that were created. This information is very useful when fsck is attempting to repair a heavily damaged file system.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;After you create the file systems, be sure to enter them into the /etc/vfstab file so that they are mounted the next time you reboot.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If you need to make the root partition bootable, you still have two more steps. The first is to clone the root partition from your existing system to the new root partition using:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;# mount /dev/dsk/c0t1d0s0 /mnt&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;# ufsdump 0uf - / | ufsrestore -rf -&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Once the file root partition is cloned, you can run the installboot program like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# /usr/sbin/installboot /usr/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Be sure to test your new file systems before you need to rely on them in a disaster situation.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;IRIX For this example, we are creating a large scratch partition for a user who does modeling and simulations. Although IRIX has many GUI-based tools to perform these tasks, it is always a good idea to learn the command line versions just in case you need to do any kind of remote administration.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Creating partitions Once the drive is attached, run a program called hinv to take a "hardware inventory." On the sample system, you saw the following output:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;...&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Integral SCSI controller 1: Version WD33C93B, revision D&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;  &lt;/span&gt;Disk drive: unit 6 on SCSI controller 1&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Integral SCSI controller 0: Version WD33C93B, revision D&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;  &lt;/span&gt;Disk drive: unit 1 on SCSI controller 0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;...&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Our new disk is external to the system, so we know it is residing on controller 1. Unit 6 is the only disk on that chain, so we know that it is the disk we just added to the system.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To partition the disk, run the fx command without any parameters. It prompts us for the device name, controller, and drive number. Choose the default device name and enter the appropriate information for the other two questions.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;On our sample system, this would look like:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# fx&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fx version 6.2, Mar&lt;span style=""&gt;  &lt;/span&gt;9, 1996&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fx: "device-name" = (dksc)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fx: ctlr# = (0) 1&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fx: drive# = (1) 6&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fx: lun# = (0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;...opening dksc(1,6,0)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;...controller test...OK&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Scsi drive type == SEAGATE ST32550N&lt;span style=""&gt;        &lt;/span&gt;0022&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;----- please choose one (? for help, .. to quit this menu)-----&lt;/p&gt;  &lt;p class="MsoNormal"&gt;[exi]t&lt;span style=""&gt;               &lt;/span&gt;[d]ebug/&lt;span style=""&gt;             &lt;/span&gt;[l]abel/&lt;/p&gt;  &lt;p class="MsoNormal"&gt;[b]adblock/&lt;span style=""&gt;          &lt;/span&gt;[exe]rcise/&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;[r]epartition/&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fx&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We see that fx found our Seagate and is ready to work with it. From the menu we select r to repartition the disk. fx displays what it knows about the disk and then presents another menu specifically for partitioning the disk.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fx&gt; r&lt;/p&gt;  &lt;p class="MsoNormal"&gt;----- partitions-----&lt;/p&gt;  &lt;p class="MsoNormal"&gt;part&lt;span style=""&gt;  &lt;/span&gt;type&lt;span style=""&gt;       &lt;/span&gt;cyls&lt;span style=""&gt;             &lt;/span&gt;blocks&lt;span style=""&gt;          &lt;/span&gt;Megabytes&lt;span style=""&gt;   &lt;/span&gt;(base+size)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;  &lt;/span&gt;7: xfs&lt;span style=""&gt;        &lt;/span&gt;3 + 3521&lt;span style=""&gt;       &lt;/span&gt;3570 + 4189990&lt;span style=""&gt;       &lt;/span&gt;2 + 2046&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;  &lt;/span&gt;8: volhdr&lt;span style=""&gt;     &lt;/span&gt;0 + 3&lt;span style=""&gt;             &lt;/span&gt;0 + 3570&lt;span style=""&gt;          &lt;/span&gt;0 + 2&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;10: volume&lt;span style=""&gt;     &lt;/span&gt;0 + 3524&lt;span style=""&gt;          &lt;/span&gt;0 + 4193560&lt;span style=""&gt;       &lt;/span&gt;0 + 2048&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;capacity is 4194058 blocks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;----- please choose one (? for help, .. to quit this menu)-----&lt;/p&gt;  &lt;p class="MsoNormal"&gt;[ro]otdrive&lt;span style=""&gt;        &lt;/span&gt;[u]srrootdrive&lt;span style=""&gt;     &lt;/span&gt;[o]ptiondrive&lt;span style=""&gt;      &lt;/span&gt;[re]size&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fx/repartition&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Looking at the result, we see that this disk has never been partitioned in IRIX before. Part 7 represents the amount of partitionable space, part 8 the volume header, and part 10 the entire disk.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Because this disk is going to be used as a large scratch partition, we want to select the optiondrive option from the menu. After you select that, you are asked what kind of file system you want to use. IRIX 6 and above defaults to xfs, while IRIX 5 defaults to efs. Use the one appropriate for your version of IRIX.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Our sample system is running IRIX 6.3, so we accept the default of xfs:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fx/repartition&gt; o&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fx/repartition/optiondrive: type of data partition = (xfs)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Next we are asked whether we want to create a /usr log partition. Because our primary system already has a /usr partition, we don't need one here. Type no.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fx/repartition/optiondrive: create usr log partition? = (yes) no&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The system is ready to partition the drive. Before it does, it gives one last warning allowing you to stop the partitioning before it completes the job. Because you know you are partitioning the correct disk, you can give it "the go-ahead":&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Warning: you must reinstall all software and restore user data from backups after changing the partition layout. Changing partitions causes all data on the drive to be lost. Be sure you have the drive backed up if it contains any user data. Continue? y&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The system takes a few seconds to create the new partitions on the disk. Once it is done, it reports what the current partition list looks like.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;----- partitions-----&lt;/p&gt;  &lt;p class="MsoNormal"&gt;part&lt;span style=""&gt;  &lt;/span&gt;type&lt;span style=""&gt;       &lt;/span&gt;cyls&lt;span style=""&gt;             &lt;/span&gt;blocks&lt;span style=""&gt;           &lt;/span&gt;Megabytes&lt;span style=""&gt;   &lt;/span&gt;(base+size)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;  &lt;/span&gt;7: xfs&lt;span style=""&gt;         &lt;/span&gt;3 + 3521&lt;span style=""&gt;         &lt;/span&gt;3570 + 4189990&lt;span style=""&gt;   &lt;/span&gt;2 + 2046&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;  &lt;/span&gt;8: volhdr&lt;span style=""&gt;      &lt;/span&gt;0 + 3&lt;span style=""&gt;            &lt;/span&gt;0 + 3570&lt;span style=""&gt;         &lt;/span&gt;0 + 2&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;10: volume&lt;span style=""&gt;      &lt;/span&gt;0 + 3524&lt;span style=""&gt;         &lt;/span&gt;0 + 4193560&lt;span style=""&gt;      &lt;/span&gt;0 + 2048&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;capacity is 4194058 blocks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;----- please choose one (? for help, .. to quit this menu)-----&lt;/p&gt;  &lt;p class="MsoNormal"&gt;[ro]otdrive&lt;span style=""&gt;        &lt;/span&gt;[u]srrootdrive&lt;span style=""&gt;     &lt;/span&gt;[o]ptiondrive&lt;span style=""&gt;      &lt;/span&gt;[re]size&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fx/repartition&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Looks good. We can exit fx now by typing .. at the fx/repartition&gt; prompt and exit at the fx&gt; prompt.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Our one large scratch partition is now called /dev/dsk/dks1d6s7.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Creating the filesystem To create the file system, we use the mkfs command like this:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;# mkfs /dev/rdsk/dks1d6s7&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This generates the following output:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;meta-data=/dev/dsk/dks1d6s7&lt;span style=""&gt;      &lt;/span&gt;isize=256&lt;span style=""&gt;    &lt;/span&gt;agcount=8, agsize=65469 blks&lt;/p&gt;  &lt;p class="MsoNormal"&gt;data&lt;span style=""&gt;     &lt;/span&gt;=&lt;span style=""&gt;                       &lt;/span&gt;bsize=4096&lt;span style=""&gt;   &lt;/span&gt;blocks=523748, imaxpct=25&lt;/p&gt;  &lt;p class="MsoNormal"&gt;log&lt;span style=""&gt;      &lt;/span&gt;=internal log&lt;span style=""&gt;           &lt;/span&gt;bsize=4096&lt;span style=""&gt;   &lt;/span&gt;blocks=1000&lt;/p&gt;  &lt;p class="MsoNormal"&gt;realtime =none&lt;span style=""&gt;                   &lt;/span&gt;bsize=65536&lt;span style=""&gt;  &lt;/span&gt;blocks=0, rtextents=0&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Remember to add this entry into the /etc/fstab file so that the system automatically mounts the next time you reboot. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Summary&lt;/p&gt;  &lt;p class="MsoNormal"&gt;As you've seen in this chapter, creating, maintaining, and repairing filesystems is not a trivial task. It is, however, a task which should be well understood. An unmaintained file system can quickly lead to trouble and without its stability, the remainder of the system is useless.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Let's make a quick rundown of the topics we covered: &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Disks are broken into partitions (sometimes called slices). &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Each partition has a file system. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A file system is the primary means of file storage in UNIX. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;File systems are made of inodes and superblocks. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Some partitions are used for raw data such as swap. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The /proc file system really isn't a file system, but an abstraction to kernel data. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;An inode maintains critical file information. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Superblocks track disk information as well as the location of the heads of various inode lists. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In order for you to use a file system, it must be mounted. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;No one must be accessing a file system in order for it to be unmounted. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;File systems can be mounted anywhere in the directory tree. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;/etc/fstab (vfstab in Solaris) is used to by the system to automatically mount file systems on boot. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The root file system should be kept away from users. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The root file system should never get filled. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Be sure to watch how much space is being used. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;fsck is the tool to use to repair file systems. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Don't forget to terminate your SCSI chain! &lt;/p&gt;  &lt;p class="MsoNormal"&gt;In short, file systems administration is not a trivial task and should not be taken lightly. Good maintenance techniques not only help maintain your uptime, but your sanity as well. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;©Copyright, Macmillan Computer Publishing. All rights reserved. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/345201392220129351-8172836855144998610?l=unixfaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixfaq.blogspot.com/feeds/8172836855144998610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=345201392220129351&amp;postID=8172836855144998610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/8172836855144998610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/8172836855144998610'/><link rel='alternate' type='text/html' href='http://unixfaq.blogspot.com/2008/10/unix-file-system.html' title='Unix File System'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-345201392220129351.post-2830626472936272837</id><published>2008-08-28T23:57:00.002-07:00</published><updated>2008-12-23T00:12:05.690-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What Is System Administration?</title><content type='html'>&lt;h1 align="center"&gt;&lt;span style="color:#000077;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h1&gt;     &lt;p&gt;&lt;i&gt;By Eric Goebelbecker&lt;/i&gt;&lt;/p&gt;    &lt;p&gt;System Administration is planning, installing, and maintaining computer systems.    If that seems like a very generalized answer, it's because "What is System Administration"    is a broad question.&lt;/p&gt;    &lt;p&gt;In this chapter we'll describe what is expected from a System Administrator, and    how she might approach her responsibilities.&lt;/p&gt;      &lt;blockquote&gt;    &lt;p&gt; &lt;/p&gt;&lt;hr /&gt; &lt;span style="color:#000077;"&gt;&lt;b&gt;Help Wanted&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;   Administer Sun and IBM UNIX systems and control Internet access. Assist with some    database administration (Oracle). Administer Sun server and network: system configuration,    user id/creation/maintenance, security administration, system backup, and ensuring    all applications are running on the system properly. Administer Internet access and    services: internal/external security, user identification creation and maintenance,    and Web server maintenance.  &lt;hr /&gt;      &lt;/blockquote&gt;     &lt;p&gt;This is a typical "Help Wanted" advertisement for a UNIX System Administration    position. From this description you might guess that a System Administrator has to    install and configure the operating system, add new users, back up the system(s),    keep the systems secure, and make sure they stay running. Setting up Internet access    and keeping it running is part of the job too.&lt;/p&gt;    &lt;p&gt;Unfortunately, you'd only be considering about half of the job. Being an expert    on installing, running, and maintaining all of the major UNIX variants isn't enough    to be a truly good system administrator. There is a significant nontechnical component    to being a system administrator, especially in terms of planning, organizational,    and people skills.&lt;/p&gt;    &lt;p&gt;As computers become more and more pervasive in business, system administration    becomes a mission critical position in more and more organizations. The administrator    has to understand the systems that he is responsible for, the people who use them,    and the nature of the business that they are used for. A key skill in administration    is planning, because at the rate that systems are being created, overhauled, and    expanded, trying to improvise and design a network "on the fly" just doesn't    work.&lt;/p&gt;    &lt;p&gt;Companies are moving more and more processes not just to computers, but to point    of sale systems, such as Web commerce and sophisticated in-store systems, such as    electronic catalogs and cash registers that are directly connected to both inventory    and credit systems. Companies that may have moved their inventory control to computers    five years ago are scrambling to get order entry computerized and on the Web, while    companies that haven't automated their inventory and ordering systems yet are scrambling    to do so in order to remain competitive. E-mail is now regarded as just as important    as faxes and telephones, while every part of customer service that can be manned    by a computer and fax retrieval system already is. These companies are almost completely    dependent on their computers, and their system administrators need to understand    a lot more than how to partition a disk drive, add memory, and install Adobe PhotoShop.&lt;/p&gt;    &lt;p&gt;This chapter introduces some of the basic technical and organizational concepts    that a system administrator needs to know in order to perform his job well. It also    covers a few key system administration tools that are already found with most UNIX    variants or are included on the UNIX Unleashed CD that accompanied this book.&lt;/p&gt;    &lt;p&gt;The chapter is divided into the following sections:    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Technical Concepts for System Administrators--in this section we introduce some     of UNIX's important characteristics and how they differ from operating systems like     Windows and Macintosh.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;UNIX is Heterogeneous--this section describes UNIX's diverse and sometimes self-contradictory     user interfaces and how those interfaces ended up that way.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;System Administration Tasks--this part of the chapter is where basic administration     tasks and responsibilities are introduced.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Administration Resources--both the operating system itself and the Internet provide     a wide variety of information for administrators. This section provides a few pointers     to these resources.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Tools of the Trade--UNIX provides users and administrators with an amazing set     of tools. We briefly cover a few of them in the end of this chapter.    &lt;/li&gt;&lt;/ul&gt;      &lt;blockquote&gt;    &lt;p&gt; &lt;/p&gt;&lt;hr /&gt; &lt;span style="color:#000077;"&gt;&lt;b&gt;TIP:&lt;/b&gt; &lt;/span&gt;No one, regardless of how long they've "been    in the business" can remember all of the configuration options, command line    switches, oddities, and outright bugs in the UNIX tool chest. Experienced users soon    learn the value of UNIX's online documentation, the &lt;i&gt;manual pages. &lt;/i&gt;Before you    use any tool, read the man page(s) for it; many of them include useful examples.    If you install a utility from the CD, be sure you read the installation instructions    that accompany it and install the man page too. Later in this chapter we'll cover    some advanced features found in the manual page system.  &lt;hr /&gt;      &lt;/blockquote&gt;     &lt;h2&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Technical Concepts for New System Administrators&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;UNIX differs from Windows and Macintosh at a fundamental level. UNIX was originally    intended for multiple users running multiple simultaneous programs. (At least it    was by the time it was distributed outside of Bell Labs.) The phenomenon of a user    having a low cost personal workstation, running Linux or any other variant of UNIX    is actually a recent development in terms of the operating system's history. The    fact that UNIX is designed for use by more than a single user is reflected throughout    the operating system's file systems, security features, and programming model.&lt;/p&gt;    &lt;p&gt;Networking is not an afterthought or a recent development for UNIX, the way it    seems to be for Windows and Macintosh. Support for sharing files, moving from workstation    to workstation, and running applications on remote computers that are controlled    and viewed on a local workstation is not only intuitive and natural on UNIX, but    was more powerful and stable on past versions of UNIX than the latest versions of    Windows and Windows NT.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Multiple Users and Multiple Accounts&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;The DOS/Windows and Macintosh environments are "computer centric" in    terms of security and customization. The ownership of files and &lt;i&gt;processes&lt;/i&gt;    (programs that are currently running) is more or less governed by the computer where    they are located as opposed to the notion of a user id or session. If a person can    physically get to a computer, he has access to all of the files and programs on it.    If a truly malicious person wants access to the contents of a PC, even a password-protected    screen saver can be overcome by restarting the system, because the files and programs    belong to the PC, not a user, and the computer will boot ready for use. (Even the    login prompt on Windows 95 can be bypassed with the Cancel button, bringing the user    interface up with no network resources connected.)&lt;/p&gt;    &lt;p&gt;Add-ons are available for DOS and Macintosh systems that enable users to identify    themselves and save files in protected areas. But these are applications, not a part    of the operating system, and come with their own set of problems, limitations, and    rules. The fact is, as anyone who has ever had to share a computer with a family    member or coworker will agree, personal computer operating systems are single user    and geared toward supporting one user and one set of configuration options.&lt;/p&gt;    &lt;p&gt;UNIX systems are multi-user. Users must log in to the system. Each has his own    areas for saving files, the &lt;i&gt;home directory, &lt;/i&gt;and files have properties that    determine who can or cannot access them, their&lt;i&gt; mode&lt;/i&gt;. All running programs    are associated with a user, and, similar to the way files have access control, programs    can only be started or stopped by certain users. Unless a user can log in as the    &lt;i&gt;super-user&lt;/i&gt;, she cannot access another user's files unless the owner gives    her permission through one of several direct or indirect means. Only the super-user    can reboot the computer (without the power switch) or stop another user's processes.    Even if a system is rebooted, all of the security features will be remain effect,    so restarting is not a valid means of subverting security.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Network Centricity&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;Networking has become an integral part of UNIX. The ability to share files, support    network logins, share network configuration information, and run applications across    a network is included in all of the major UNIX distributions, and more importantly    is a natural extension of the base operating system, not an application that was    designed by an individual vendor, with their idea of networking and administration,    and that has to be purchased separately.&lt;/p&gt;    &lt;p&gt;When configured to allow it, anything that can be done at the &lt;i&gt;console&lt;/i&gt; (main    keyboard and monitor) of a UNIX system can be done at another system via a network    connection. (We'll refer to these other systems as &lt;i&gt;remote nodes &lt;/i&gt;or &lt;i&gt;remote    systems.&lt;/i&gt;) Actually many server systems, such as Web servers and file servers,    have consoles with very limited capabilities (such as a text-only terminal), and    are deliberately designed with the idea of doing as much administration as possible    from remote nodes outside the data center.&lt;/p&gt;    &lt;p&gt;Two of the mechanisms that provide these capabilities are &lt;i&gt;remote &lt;/i&gt;(or &lt;i&gt;pseudo&lt;/i&gt;)    terminals&lt;i&gt; &lt;/i&gt;and &lt;i&gt;remote shells. &lt;/i&gt;Remote terminals emulate an actual terminal    session, just as if the user were logged into a terminal connected to the system    via a serial line, where the network is the line and the application (usually &lt;i&gt;telnet)&lt;/i&gt;    is the terminal (Remote terminals are usually referred to as telnet sessions, since    telnet is by far the most common application.) This is similar, in theory at least,    to dialing into a system and using an application like Procomm.&lt;/p&gt;    &lt;p&gt;Remote shells (or remote logins) are sessions on remote computers that are centered    around the execution of a shell (or shell command) instead of a terminal on a remote    system. A remote shell executes a command on a remote host, while a remote login    runs a shell; both usually appear to be running on the local system. Remote shells    are frequently used by administrators in shell scripts, allowing them to execute    commands on several systems and consolidate the results in one place, such as collecting    disk utilization statistics or automating backups.&lt;/p&gt;    &lt;p&gt;The differences between a remote shell and a telnet session are very important.    Telnet sessions use terminal emulation and are run as separate applications. So the    results cannot be shared with other applications unless a mechanism such as cut and    paste is used, while remote shells allow the results of commands to be interspersed    with local commands.&lt;/p&gt;    &lt;p&gt;So a directory on one workstation could be backed up to a tape drive on another    via a simple shell command:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;tar cvfb  - tgt_dir | rsh -n bilbo dd of=/dev/rmt/0&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;The &lt;tt&gt;tar&lt;/tt&gt; command creates an archive&lt;b&gt; &lt;/b&gt;of &lt;tt&gt;tgt_dir&lt;/tt&gt; and sends    it to &lt;i&gt;standard output.&lt;/i&gt;&lt;b&gt; &lt;/b&gt;This stream of data is redirected to the &lt;tt&gt;rsh&lt;/tt&gt;    command. r&lt;tt&gt;sh&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;connects to the host &lt;tt&gt;bilbo&lt;/tt&gt;, executes &lt;tt&gt;dd&lt;/tt&gt;,    and passes the output of &lt;tt&gt;tar&lt;/tt&gt; to it. The &lt;tt&gt;dd&lt;/tt&gt; command just happens    to know how to save the archive to the tape drive on &lt;tt&gt;/dev/rmt/0&lt;/tt&gt;&lt;b&gt;. &lt;/b&gt;(This    may seem complicated. By the end of this chapter, it will make perfect sense.) So    two programs on two different computers are linked as one, without any special configuration    requirements or extra software.&lt;/p&gt;    &lt;p&gt;With remote logins and shells being so powerful, why would anyone use telnet?    One reason is that telnet is much more robust over slow links, such as Internet and    WAN connections between different sites than remote logins, The other is security.    We'll cover some of the risks posed by remote shells later.&lt;/p&gt;    &lt;p&gt;X-windows is another example of UNIX's networking prowess. The X environment is    a graphical user interface, much like the Windows or Macintosh environments. A key    difference is that it is segmented into a client (the application) and a server (the    display.) The server is a process that manages the keyboard, mouse, and screen, and    accepts connections from applications over a &lt;tt&gt;socket&lt;/tt&gt; (a network connection).    Because a network connection is the method of communication between the two programs,    the application can be running on a different workstation than the display that is    controlling it. (When applications are running on the same workstation as the server,    the network connection is frequently bypassed in favor of faster methods. These enhancements    are proprietary extensions and differ widely from vendor to vendor.)&lt;/p&gt;    &lt;p&gt;The remote functionality of X-windows is a very powerful advantage, especially    when considered in terms of large database, Web, or file servers that tend to be    installed in data centers or equipment rooms, but have graphical management and configuration    applications. Another possibility is installing slower, less expensive workstations    on desktops while still being able to run more demanding applications on shared,    more powerful computers.&lt;/p&gt;    &lt;p&gt;File sharing is another extension that has become a natural and integral part    of UNIX computing. All of the major UNIX variants support &lt;i&gt;NFS &lt;/i&gt;(Network File    System) and can share files seamlessly between themselves and other UNIX versions.&lt;/p&gt;    &lt;p&gt;Because NFS file systems are treated like any other type of disk, the same way    SCSI, IDE, and floppy disks are implemented, network drives fully support user accounts,    file permissions, and all of the mechanisms UNIX already uses for adding, removing,    and managing other types of files and file systems, even when shared between different    UNIX variants.&lt;/p&gt;    &lt;p&gt;This means that two UNIX systems, regardless of what version of UNIX or on what    type of computer they happen to be, can share files, maybe even from a common file    server running on a third system type. Only the user IDs have to be coordinated in    order for the files to be securely shared. No additional software or special modifications    are required.&lt;/p&gt;    &lt;p&gt;Any UNIX system can &lt;i&gt;export&lt;/i&gt; or &lt;i&gt;share &lt;/i&gt;file systems. This is one of    the ways that the difference between servers and clients is blurred with UNIX systems;    any system can provide or consume file system resources. When file systems are shared,    the workstation can specify which systems can and cannot use it, and also whether    or not users may write to it.&lt;/p&gt;    &lt;p&gt;Clients specify where the file system will be mounted in their directory tree.    For example, a system can mount the &lt;tt&gt;/export/applications&lt;/tt&gt; directory from    another system to the &lt;tt&gt;/mnt/apps&lt;/tt&gt; directory.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;UNIX Networking: Sharing files and Information&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;Consider the following practical applications to illustrate how UNIX networking    works, and how some common tools and planning can make administration very easy.&lt;/p&gt;    &lt;p&gt;A system that is frequently used to administer NFS is the &lt;i&gt;automounter.&lt;/i&gt;    This program (or set of programs) allows administrators to specify file systems to    be &lt;i&gt;mounted&lt;/i&gt; (attached) and &lt;i&gt;unmounted&lt;/i&gt; (detached) as needed, based on    when clients refer to them. This process happens completely in the background, without    any intervention after the automount program(s) are configured properly.&lt;/p&gt;      &lt;blockquote&gt;    &lt;p&gt; &lt;/p&gt;&lt;hr /&gt; &lt;span style="color:#000077;"&gt;&lt;b&gt;LINUX&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;br /&gt;   &lt;/b&gt;Linux systems use a publicly available application called &lt;tt&gt;amd&lt;/tt&gt;&lt;i&gt; &lt;/i&gt;instead    of &lt;tt&gt;automount&lt;/tt&gt;. Although the configuration files differ slightly, the functionality    &lt;tt&gt;amd&lt;/tt&gt; provides Linux is the same. &lt;tt&gt;amd&lt;/tt&gt; is provided with all of the    major Linux distributions. As always, see the manual page for specifics.  &lt;hr /&gt;      &lt;/blockquote&gt;     &lt;p&gt;&lt;tt&gt;automount&lt;/tt&gt; is configured with &lt;i&gt;maps &lt;/i&gt;(a fancy term used for referring    to configuration files)&lt;i&gt;, &lt;/i&gt;where each map specifies a top level directory. So,    if the automount system is to create five directories, the &lt;i&gt;master&lt;/i&gt; map, which    is contained in the file &lt;tt&gt;/etc/auto_master&lt;/tt&gt; might look like this:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;/share         auto_share&lt;br /&gt;/home          auto_home&lt;br /&gt;/gnu           auto_gnu&lt;br /&gt;/apps          auto_apps&lt;br /&gt;/opt           auto_opt&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;This file provides the &lt;tt&gt;automount&lt;/tt&gt; with the names of the directories it    will create and the files that contain what the directories will contain.&lt;/p&gt;    &lt;p&gt;For example, let's look at an organization that decided that all user directories    belong under the directory &lt;tt&gt;/home&lt;/tt&gt;. (Therefore, the user &lt;tt&gt;dan&lt;/tt&gt; would    find his files in &lt;tt&gt;/home/dan&lt;/tt&gt;.)&lt;b&gt; &lt;/b&gt;The first thirty home directories were    located on the file server &lt;tt&gt;gandalf&lt;/tt&gt; in the &lt;tt&gt;/export/home&lt;/tt&gt; directory.&lt;/p&gt;    &lt;p&gt;When the next user comes along, the administrator realizes that &lt;tt&gt;gandalf&lt;/tt&gt;    does not have enough drive space for a new user, and, as a matter of fact, moving    a couple of users over to the other file server, &lt;tt&gt;balrog&lt;/tt&gt;, which has been    used for applications until now, would probably be a good idea.&lt;/p&gt;    &lt;p&gt;&lt;tt&gt;automount&lt;/tt&gt; simplifies this distribution by allowing us to create a virtual    &lt;tt&gt;/home&lt;/tt&gt; directory on every workstation that runs the &lt;tt&gt;automount&lt;/tt&gt; daemon.    An excerpt from the home directory map, &lt;tt&gt;/etc/auto_home&lt;/tt&gt;,&lt;b&gt; &lt;/b&gt;as named    in &lt;tt&gt;/etc/auto_master&lt;/tt&gt; above, would look like this:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;eric  gandalf:/export/home/eric&lt;br /&gt;dan   gandalf:/export/home/dan&lt;br /&gt;mike  balrog:/export/home/michael&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;In this map, &lt;tt&gt;eric&lt;/tt&gt;, &lt;tt&gt;dan&lt;/tt&gt;, and &lt;tt&gt;mike&lt;/tt&gt; are referred to as    directory &lt;i&gt;keys&lt;/i&gt;. The directories are called &lt;i&gt;values. &lt;/i&gt;When a program refers    to &lt;tt&gt;/home/eric&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;for the first time&lt;b&gt;, &lt;/b&gt;the system recognizes the    key &lt;tt&gt;eric&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;and arranges for &lt;tt&gt;/export/home/eric&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;on &lt;tt&gt;gandalf&lt;/tt&gt;&lt;b&gt;    &lt;/b&gt;to be mounted at &lt;tt&gt;/home/eric&lt;/tt&gt;. Because &lt;tt&gt;automount&lt;/tt&gt; does a simple    key/value replacement, Eric and Dan's directories can be on &lt;tt&gt;gandalf&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;while    Mike's is on &lt;tt&gt;balrog&lt;/tt&gt;&lt;b&gt;. &lt;/b&gt;Also note&lt;b&gt; &lt;/b&gt;that the directory names in    b&lt;tt&gt;alrog&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;and the automounter &lt;i&gt;virtual&lt;/i&gt; directory do not have to    agree. After a period of inactivity, &lt;tt&gt;automount&lt;/tt&gt; unmounts the directory.&lt;/p&gt;    &lt;p&gt;&lt;tt&gt;automount&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;alleviates the tedious task of mounting all of the directories    that a user or group of users will need in advance. Permanently mounting all of those    file systems leads to unnecessary system overhead and requires excessive human intervention.    This system also makes it easier for users to travel from workstation to workstation,    since they can always expect to find important application and data files in the    same place.&lt;/p&gt;    &lt;p&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Solaris&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;br /&gt;   &lt;/b&gt;Sun Microsystems defined &lt;i&gt;autofs&lt;/i&gt; as a new file system type in Solaris 2.x,    and created a multi-threaded automounter system. This makes automounted file systems    perform extraordinarily well under Solaris, since the kernel is now aware that automounted    file systems exist and by preventing bottlenecks in the automount program through    the use of threads.&lt;/p&gt;    &lt;p&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;HP-UX&lt;br /&gt;   AIX&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;br /&gt;   &lt;/b&gt;Hewlett Packard's&lt;b&gt; &lt;/b&gt;HP-UX and IBM's AIX provide a version of &lt;tt&gt;automount.&lt;/tt&gt;    Since &lt;tt&gt;automount&lt;/tt&gt; uses NFS, it is compatible across different UNIX variants.&lt;/p&gt;    &lt;p&gt;Newer versions of &lt;tt&gt;automount&lt;/tt&gt; (and &lt;tt&gt;amd&lt;/tt&gt;) also enable us to specify    more than one file server for a directory, in order to provide a backup for when    one file server is unavailable or overloaded. This system, with a little planning    and thought, can simplify a distributed network and even make it a little more reliable.&lt;/p&gt;    &lt;p&gt;The maps, however, still must be kept up to date and distributed to each workstation.    This could be done using &lt;tt&gt;ftp&lt;/tt&gt;&lt;i&gt;, &lt;/i&gt;or even &lt;tt&gt;nfs&lt;/tt&gt;&lt;b&gt;, &lt;/b&gt;but on    a large network this can become tedious. There are two very elegant solutions that    are examples of how experienced system administrators tend to solve these problems.&lt;/p&gt;    &lt;p&gt;The first is a tool called &lt;tt&gt;rdist&lt;/tt&gt;&lt;b&gt;. &lt;/b&gt;It is a tool for maintaining    identical copies of software between remote hosts. It can accept filenames from the    command line or use a configuration file (usually referred to as a &lt;i&gt;distfile) &lt;/i&gt;that    lists what files to copy to which hosts.&lt;/p&gt;    &lt;p&gt;In order to distribute a set of automounter maps we might use a &lt;i&gt;distfile&lt;/i&gt;    like this simple example:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;HOSTS = (bilbo frodo thorin snowball)&lt;br /&gt;FILES = /etc/auto_master /etc/auto_home /etc/auto_apps&lt;br /&gt;${FILES}-&gt;${HOSTS}&lt;br /&gt;       install;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;The distfile&lt;i&gt; &lt;/i&gt;is a very powerful mechanism. In this example, we take advantage    of the ability to create variables&lt;i&gt;.&lt;/i&gt; By specifying the hosts to be updated    and the files to send in lists, we can easily add to them. After we define $FILES    and $HOSTS, we indicate that the lists of files should be kept up to date on the    hosts that are listed&lt;b&gt;.&lt;/b&gt; &lt;tt&gt;install&lt;/tt&gt;&lt;i&gt; &lt;/i&gt;(the one line command after    the dependency line) is one of many &lt;tt&gt;rdist&lt;/tt&gt; commands, it indicates the &lt;tt&gt;rdist&lt;/tt&gt;    should keep the files up to date with the local copies. See the man page for more    information on the numerous directives and &lt;tt&gt;distfile&lt;/tt&gt; options.&lt;/p&gt;    &lt;p&gt;To use this we could add the &lt;tt&gt;distfile&lt;/tt&gt; to the &lt;tt&gt;/etc&lt;/tt&gt; directory    on the host where the master set of automounter maps are created. Whenever we make    a change, we would execute:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;rdist -f /etc/auto_distfile&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;&lt;tt&gt;rdist&lt;/tt&gt; can be used for much more complicated tasks, such as synchronizing    user directories between redundant file servers or distributing new versions of software    packages where &lt;tt&gt;nfs&lt;/tt&gt; is not being used.&lt;/p&gt;    &lt;p&gt;The disadvantage behind &lt;tt&gt;rdist&lt;/tt&gt; is that it has the same security requirement    as any other&lt;b&gt; &lt;/b&gt;remote shell command. The user executing the &lt;tt&gt;rdist&lt;/tt&gt; command    must be able to attach to the remote host and execute commands without a password.    (Refer to the following "Network Security Issues" section.)&lt;/p&gt;    &lt;p&gt;If the security issues associated with &lt;tt&gt;rdist&lt;/tt&gt; are unacceptable, how could    we conveniently distribute these maps?&lt;/p&gt;    &lt;p&gt;Sun Microsystems's&lt;b&gt; &lt;/b&gt;&lt;i&gt;Network Information Service&lt;/i&gt;&lt;b&gt; &lt;/b&gt;(NIS)&lt;b&gt; &lt;/b&gt;(also    frequently called "yp" or yellow pages) may be an acceptable alternative.    NIS provides common configuration information, such as IP addresses, service port    numbers, and automount maps to hosts on a network from a server or set of servers.&lt;/p&gt;    &lt;p&gt;The NIS server(s) have master copies of the files that are made available. Instead    of copying the files to the clients, they are distributed as needed across the network.    So the clients retrieve the information from the server instead of reading files.&lt;/p&gt;    &lt;p&gt;NIS is used for &lt;tt&gt;hosts&lt;/tt&gt;&lt;b&gt;, &lt;/b&gt;&lt;tt&gt;services&lt;/tt&gt;&lt;b&gt;, &lt;/b&gt;&lt;tt&gt;passwd&lt;/tt&gt;&lt;b&gt;,    &lt;/b&gt;&lt;tt&gt;automount&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;and a few other configuration files. Configuring a    network for NIS is beyond the scope of this chapter, and is not the same for each    UNIX variant, since many vendors made their own "improvements" on Sun's    system. Thoroughly consult the documentation for the platform(s) that you are using    before you try to implement it, and make sure you understand any changes that the    vendor's have made. NIS does have some advantages and drawbacks that we can cover.&lt;/p&gt;    &lt;p&gt;The main advantage to NIS is convenience. Changes can be made to a map and made    available to clients almost instantly, usually by executing a single command after    the file is edited. Being able to keep all of this information in one place (or a    few places if secondary servers are used) is obviously convenient, especially since    synchronizing user IDs, IP addresses, and service ports is crucial to keeping a network    working well.&lt;/p&gt;    &lt;p&gt;There are however, some significant disadvantages.&lt;/p&gt;    &lt;p&gt;A workstation that uses NIS to resolve IP addresses cannot use DNS for internet    addresses without some important modifications. Sun's NIS+ solves this problem, but    is not yet widely supported by other versions of UNIX and is considered to be a proprietary    and very hard to use system. (Which is why it is not covered here.)&lt;/p&gt;    &lt;p&gt;If the &lt;tt&gt;passwd&lt;/tt&gt; file is distributed by NIS, the encrypted password field    can be read by anyone who connects to NIS. This can be used to subvert security by    many hackers, because cracking the encrypted password field is susceptible to a brute    force attack with publicly available software.&lt;/p&gt;    &lt;p&gt;NIS has no mechanism for controlling who connects to the server and reads the    maps. This adds to the security issues, and is one of the reasons you won't find    any NIS servers on the Internet. (NIS+ also addresses this issue with a complex authentication    system.)&lt;/p&gt;    &lt;p&gt;If a client cannot contact a server to handle a request, the request tends to    wait until a server is found instead of trying to find a way to continue.&lt;/p&gt;    &lt;p&gt;Obviously, NIS comes with its own set of issues, and is a system that requires    considerable examination before being selected as an administration tool.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Network Security Issues&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;We've already mentioned a few security issues regarding UNIX and networking. These    issues are very serious for administrators, and frequently have a huge impact on    how a network is configured.&lt;/p&gt;    &lt;p&gt;Earlier we mentioned that telnet is still used extensively in favor of remote    shells. Remote shells allow noninteractive logins, such as the examples above using    &lt;tt&gt;tar&lt;/tt&gt;,&lt;b&gt; &lt;/b&gt;&lt;tt&gt;dd&lt;/tt&gt;&lt;b&gt;, &lt;/b&gt;and &lt;tt&gt;rdist&lt;/tt&gt;&lt;b&gt;. &lt;/b&gt;While this is    a very convenient feature, it's also a very dangerous one when not carefully administered.&lt;/p&gt;    &lt;p&gt;The automatic login feature is implemented with a pair of text files. One of them,    &lt;tt&gt;/etc/hosts.equiv&lt;/tt&gt;,&lt;b&gt; &lt;/b&gt;controls users on the system level. The other,    &lt;tt&gt;.rhosts&lt;/tt&gt;,&lt;b&gt; &lt;/b&gt;controls access for individual users. Each file lists the    systems by name that a user can login from without supplying a password&lt;b&gt; &lt;/b&gt;if    the user ID exists on the target host&lt;b&gt;. &lt;/b&gt;All of the major UNIX variants treat    these files the same way.&lt;/p&gt;    &lt;p&gt;&lt;tt&gt;hosts.equiv&lt;/tt&gt; provides this access for an entire workstation, except for    the root account. Obviously this file should be very carefully used, if at all. The    &lt;tt&gt;.rhosts&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;file provides access for individual users, and is located    in the user's home directory. It is consulted instead of &lt;tt&gt;hosts.equiv&lt;/tt&gt;. If    the &lt;tt&gt;root&lt;/tt&gt; account has one of these files, then the &lt;tt&gt;root&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;account    from the listed hosts may enter the workstation without any authentication at all&lt;b&gt;,    &lt;/b&gt;since the &lt;tt&gt;.rhosts&lt;/tt&gt; effectively supercedes the &lt;tt&gt;hosts.equiv&lt;/tt&gt; file.&lt;/p&gt;    &lt;p&gt;So the convenience of the remote logins and commands&lt;b&gt; &lt;/b&gt;comes with a high    price. If a set of workstations were configured to allow &lt;tt&gt;root&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;to    travel back and forth without authentication than a malicious or, maybe even worse,    ill-informed user only needs to compromise one of them in order to wreak havoc on    them all.&lt;/p&gt;    &lt;p&gt;Some possible precautions are:    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Use root as little as possible. Root should never be used for remote operations&lt;b&gt;     &lt;/b&gt;is a simple enough general rule.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Avoid using &lt;tt&gt;rlogin&lt;/tt&gt; where &lt;tt&gt;telnet&lt;/tt&gt; will do.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;If you must use &lt;tt&gt;rlogin&lt;/tt&gt;, try to get by without using &lt;tt&gt;.rhosts&lt;/tt&gt;     or &lt;tt&gt;hosts.equiv&lt;/tt&gt;.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;If you need to use noninteractive logins for operations such as backups or information     collection, create a special account for it that only has access to the files and     devices necessary for the job.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Remote logins are just about out of the question on any systems that are directly     connected to the Internet. (Please note that a home system that is dialing into the     Internet through an ISP is not truly directly connected.)    &lt;/li&gt;&lt;/ul&gt;    &lt;p&gt;A little bit of explanation regarding the first rule is in order. The &lt;tt&gt;root&lt;/tt&gt;    account should be used as little as possible in day-to-day operations. Many UNIX    neophytes feel that &lt;tt&gt;root&lt;/tt&gt; access is necessary to accomplish anything worthwhile,    when that's not true at all. There is no reason for common operations, such as performing    backups, scanning logs, or running network services to be done as &lt;tt&gt;root&lt;/tt&gt;.    (Other than the services that use ports numbered less than 1024. For historical reasons    UNIX only allows processes run as &lt;tt&gt;root&lt;/tt&gt; to monitor these ports.) The more    situations where &lt;tt&gt;root&lt;/tt&gt; is used, the more likely it is that something unexpected    and quite possibly disastrous will occur.&lt;/p&gt;    &lt;p&gt;Even beyond remote logins, UNIX offers a lot of network services. File sharing,    e-mail, X-windows, and information services, such as DNS and NIS, comprise only part    of the flexibility and extensibility offered by networking. However many of these    services represent risks that are not always necessary and sometimes are unacceptable.&lt;/p&gt;    &lt;p&gt;The right way to handle these services is to evaluate which ones are needed and    enable only them. Many network services are managed by &lt;tt&gt;inetd&lt;/tt&gt;&lt;b&gt;. &lt;/b&gt;This    daemon process listens for requests for network services and executes the right program    in order to service them.&lt;/p&gt;    &lt;p&gt;For example&lt;b&gt;, &lt;/b&gt;the ftp service is administered by &lt;tt&gt;inetd&lt;/tt&gt;&lt;b&gt;. &lt;/b&gt;When    a request for the ftp service (service port number 21) is received, &lt;tt&gt;inetd&lt;/tt&gt;    consults its configuration information and executes &lt;tt&gt;ftpd&lt;/tt&gt;&lt;b&gt;.&lt;/b&gt; Its input    and output streams are connected to the requester.&lt;/p&gt;    &lt;p&gt;Network services are identified by ports&lt;b&gt;. &lt;/b&gt;Common services such as ftp and    telnet have &lt;tt&gt;well-known ports&lt;/tt&gt;, numbers that all potential clients need to    know. i&lt;tt&gt;netd&lt;/tt&gt; &lt;i&gt;binds&lt;/i&gt;&lt;b&gt; &lt;/b&gt;and&lt;b&gt; &lt;/b&gt;&lt;i&gt;listens&lt;/i&gt;&lt;b&gt; &lt;/b&gt;to these    ports based on its configuration data, contained in the file &lt;tt&gt;inetd.conf&lt;/tt&gt;&lt;b&gt;.&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;A typical configuration file looks like this:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;# Configuration file for inetd(1M).  See inetd.conf(4).&lt;br /&gt;#&lt;br /&gt;# To re-configure the running inetd process, edit this file, then&lt;br /&gt;# send the inetd process a SIGHUP.&lt;br /&gt;#&lt;br /&gt;# Syntax for socket-based Internet services:&lt;br /&gt;#  &lt;service_name&gt; &lt;socket_type&gt; &lt;proto&gt; &lt;flags&gt; &lt;user&gt; &lt;server_pathname&gt; &lt;args&gt;&lt;br /&gt;#&lt;br /&gt;ftp     stream  tcp     nowait  root    /usr/sbin/in.ftpd       in.ftpd&lt;br /&gt;telnet  stream  tcp     nowait  root    /usr/sbin/in.telnetd    in.telnetd&lt;br /&gt;#&lt;br /&gt;# Tnamed serves the obsolete IEN-116 name server protocol.&lt;br /&gt;#&lt;br /&gt;name    dgram   udp     wait    root    /usr/sbin/in.tnamed     in.tnamed&lt;br /&gt;#&lt;br /&gt;# Shell, login, exec, comsat and talk are BSD protocols.&lt;br /&gt;#&lt;br /&gt;shell   stream  tcp     nowait  root    /usr/sbin/in.rshd       in.rshd&lt;br /&gt;login   stream  tcp     nowait  root    /usr/sbin/in.rlogind    in.rlogind&lt;br /&gt;exec    stream  tcp     nowait  root    /usr/sbin/in.rexecd     in.rexecd&lt;br /&gt;comsat  dgram   udp     wait    root    /usr/sbin/in.comsat     in.comsat&lt;br /&gt;talk    dgram   udp     wait    root    /usr/sbin/in.talkd      in.talkd&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;As the comment states, information for &lt;tt&gt;inetd&lt;/tt&gt; is available on two different    manual pages.&lt;/p&gt;    &lt;p&gt;Each configuration entry states the name of the service port, which is resolved    by using the &lt;tt&gt;/etc/services&lt;/tt&gt; file (or NIS map), some more information about    the connection, the user name that the program should be run as, and, finally, the    program to run. The two most important aspects of this file, from a security standpoint,    are what user the services are run as and what services are run at all. (Details    on network connection types are covered in Chapter 20, Networking.")&lt;/p&gt;    &lt;p&gt;Each service name corresponds to a number. Ports that are numbered less than 1024,    which ftp, telnet, and login all use, can only be attached to as &lt;tt&gt;root&lt;/tt&gt;, so    &lt;tt&gt;inetd&lt;/tt&gt; itself does have to be run as &lt;tt&gt;root&lt;/tt&gt;, but it gives us the option    of running the individual programs as other users. The reason for this is simple:    If a program that is running as &lt;tt&gt;root&lt;/tt&gt; is somehow compromised, the attacker    will have &lt;tt&gt;root&lt;/tt&gt; privileges. For example, if a network service that is running    as root has a "back door" facility that allows users to modify files, an    attacker could theoretically use the program to read, copy or modify any file on    the host under attack.&lt;/p&gt;    &lt;p&gt;Some of the most serious and effective Internet security attacks exploited undocumented    features and bugs in network services that were running as &lt;tt&gt;root&lt;/tt&gt;. Therefore    the best protection against the next attack is to avoid the service completely, or    at least provide attackers with as little power as possible when they do get find    a weakness to take advantage of.&lt;/p&gt;    &lt;p&gt;Most UNIX variants come from the vendor running unneeded and, in some cases, undesirable    services, such as &lt;tt&gt;rexecd&lt;/tt&gt;&lt;b&gt;, &lt;/b&gt;which is used for the remote execution    of programs, frequently with no authentication. As you see above, this service came    from the vendor configured as &lt;tt&gt;root&lt;/tt&gt;. Many organizations configure key systems    to deny all network services except the one service that they are built to provide,    such as Internet Web and ftp servers.&lt;/p&gt;    &lt;p&gt;Well written network software also takes these issues into consideration. For    example the Apache Web Server is usually configured to listen to the &lt;tt&gt;http&lt;/tt&gt;&lt;b&gt;    &lt;/b&gt;port, which is number 80 and therefore can only be bound to by &lt;tt&gt;root&lt;/tt&gt;.    Instead of handling client requests as &lt;tt&gt;root&lt;/tt&gt; and posing a significant security    risk, Apache accepts network connections as &lt;tt&gt;root&lt;/tt&gt;, but only handles actual    requests as &lt;tt&gt;nobody&lt;/tt&gt;, a user with virtually no rights except to read Web pages.    It does this by running multiple copies of itself as &lt;tt&gt;nobody&lt;/tt&gt; and utilizing    interprocess communication to dispatch user requests to the crippled processes.&lt;/p&gt;    &lt;p&gt;Sharing files on the network poses another set of security issues. Files should    be shared carefully, with close attention to not only who can write to them, but    who can read them, because e-mail and other forms of electronic communication have    become more and more common and can contain important business information.&lt;/p&gt;    &lt;p&gt;See Chapters 20, "Networking," and 21, "System Accounting,"    for more detailed information and instructions on how to properly secure your systems.    &lt;/p&gt;&lt;h2&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;UNIX Is Heterogeneous&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;&lt;b&gt;Linux&lt;/b&gt;&lt;br /&gt;   UNIX is frequently criticized for a lack of consistency between versions, vendors    and even applications. UNIX is not the product of any single corporation or group,    and this does have a significant impact on its personality. Linux is probably the    ultimate expression of UNIX's collective identity. After Linus Torvalds created the    Linux kernel and announced it to the Internet, people from all over the world began    to contribute to what has become called the Linux Operating System. While there is    a core group of a few developers who were key in its development, they do not all    work for the same company or even live in the same country. Obviously, Linux reflects    a few different views on how computers should work. UNIX does too.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Administration Tools&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;UNIX vendors all offer their own GUI administrative tools that are generally useful,    provided that you do not have to do something that the vendor did not anticipate.    These tools vary widely in how they work and how they are implemented.&lt;/p&gt;    &lt;p&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;AIX&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;br /&gt;   &lt;/b&gt;IBM's UNIX operating system, AIX, comes with a sophisticated tool called SMIT.    Administrators can use SMIT to configure the system, add and remove users, and upgrade    software among other things. SMIT is widely considered to be the best and most mature    of the system administration systems, because it can be customized and run in either    X-windows or a terminal session. It also allows the user to view the command line    equivalent of each task before it is performed. The downside (in at least some system    administrator's opinions) is that use of SMIT is just about mandatory for some basic    administration tasks.&lt;/p&gt;    &lt;p&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;HP-UX&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;   Hewlett Packard's HP/UX has a similar tool called SAM, which provides much of the    functionality offered by SMIT but is not quite as powerful or sophisticated. Its    use is not required to administer the system, however.&lt;/p&gt;    &lt;p&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Solaris&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;   Sun's Solaris does not come with a tool comparable to SMIT or SAM. However, Sun's    individual tools for upgrading and installing software and administering NIS+ are    functional and intuitive. Unfortunately, the tool supplied with Solaris for administering    users, printers, and NIS/NIS+ requires X-windows. It is not, however required to    administer the system at all.&lt;/p&gt;    &lt;p&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Linux&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;br /&gt;   &lt;/b&gt;Linux distributions vary widely when it comes to administrative tools. RedHat    offers a powerful desktop environment for adding software, administering users, configuring    printers, and other everyday administrative tasks. Unlike the commercial tools, it's    based on scripts, not binary code, and therefore can be examined and customized by    administrators. The Slackware distribution comes with management tools for upgrading    and adding software also.&lt;/p&gt;    &lt;p&gt;In addition to the different administrative tools and environments provided by    the different UNIX vendors, each vendor has felt obligated to provide its own improvements    to UNIX over the years. Fortunately, the threat of Windows NT and its homogeneous    look and feel has made the UNIX vendors sensitive to these differences, and the tide    has turned toward standardization.&lt;/p&gt;    &lt;p&gt;UNIX has historically been divided into two major variants, AT&amp;amp;T's UNIX System    V and The University of California's BSD UNIX. Most of the major vendors are now    moving toward a System V system, but many BSD extensions will always remain.&lt;/p&gt;    &lt;p&gt;Regardless of what the vendors do (and claim to do) UNIX's heterogeneous nature    is a fact of life, and is probably one of its most important strengths, since that    nature is what's responsible for giving us some of the Internet's most important    tools, such as perl, e-mail, the Web, and Usenet News. It also provides us with a    lot of choices and how to administer our systems. Few problems in UNIX have only    one answer.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Graphical Interfaces&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;Macintosh and Microsoft Windows benefit from a user interface that is designed    and implemented by a single vendor. For the most part, a set of applications running    on one of these computers shares not only a common look and feel but the same keyboard    shortcuts, menus, and mouse movements. X-windows does not have this advantage.&lt;/p&gt;    &lt;p&gt;X-windows is a collection of applications, not an integral part of the operating    system. Because it is structured this way, it differs greatly from the windowing    systems on a Macintosh or Microsoft Windows. As a result, the relationship between    X applications and the operating system tends to be a bit more loose than on those    platforms.&lt;/p&gt;    &lt;p&gt;One of the things that gives an X desktop its "personality" is the &lt;i&gt;window    manager&lt;/i&gt;&lt;b&gt;.&lt;/b&gt; This is the application that provides each window with a border    and allows them to be moved and overlapped. However, it is just an application, not    part of the X-window system. This separation enables users to select the manager    they want, just like a shell. Individual users on the same system can also use different    window managers. The differences between window managers are significant, having    a significant impact on the look of the desktop, the way the mouse acts, and sometimes,    what applications can be run.&lt;/p&gt;    &lt;p&gt;The OpenLook&lt;b&gt; &lt;/b&gt;window manager, which is distributed by Sun and also accompanies    many Linux distributions, has many proprietary extensions and is very lightweight    and fast. It bears little resemblance, however, to Macintosh or Microsoft Windows    in look or feel. (For one thing, it makes heavy use of the right mouse button, which    Microsoft Windows only recently started to do and does not even exist on a Macintosh.)    The Sun OpenWindows package comes with OpenLook and a set of tools for reading mail,    managing files, and a few other common tasks.&lt;/p&gt;    &lt;p&gt;Motif&lt;b&gt;, &lt;/b&gt;which has many similarities with Microsoft Windows,&lt;b&gt; &lt;/b&gt;has become    more popular in the past few years, with most of the major vendors having agreed    to standardize on the &lt;i&gt;Common Desktop Environment (CDE)&lt;/i&gt;&lt;b&gt;, &lt;/b&gt;which is based    largely on Motif. The CDE also has additional features, such as a graphical file    manager, a toolbar, and support for virtual screens. The CDE also comes with a set    of user applications.&lt;/p&gt;    &lt;p&gt;Window managers also come with programming libraries for creating menus and other    programming tasks. As a result, it is possible to create an application that runs    poorly under some window managers or requires libraries that a UNIX version does    not have. This is a common problem for Motif applications on Linux, because the libraries    are not free. For this reason, many applications are available in a non-Motif version    or with the libraries &lt;i&gt;statically linked,&lt;/i&gt; which means they are built into the    application. (This is generally considered undesirable because it makes the application    larger and requires more memory and more disk space.)&lt;/p&gt;    &lt;p&gt;Windows 3.&lt;i&gt;x&lt;/i&gt; has the &lt;tt&gt;win.ini&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;and &lt;tt&gt;.ini&lt;/tt&gt; file scheme;    Windows 95 and Windows NT have the system registry. Both serve as central repositories    for application configuration information. X-windows has its own standard interface    for configuration information, called &lt;i&gt;X resources&lt;/i&gt;&lt;b&gt;. &lt;/b&gt;X resources are    more flexible in many ways than the Windows mechanisms.&lt;/p&gt;    &lt;p&gt;X resources support wildcards with parameters, which allows administrators (and    users) to standardize behavior between diverse applications. Most X-windows application    developers recognize this ability and tend to use standard naming schemes for configuration    parameters, which makes the use of wildcards even more convenient.&lt;/p&gt;    &lt;p&gt;Users are able to customize application to reflect their personal preferences    without affecting others by maintaining personal resource files, unlike single user    systems that maintain one set of parameters for an entire system. However, administrators    still have the ability to set default parameters, so users that do not wish to customize    an application still have minimal functionality.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Command Line Interfaces&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;The command line is where UNIX's long history and diversity really show. One would    think that every utility was written by a different person for a different purpose,    and one might be right.&lt;/p&gt;    &lt;p&gt;There is little cohesion between command line tools as far as the interface goes.    The directory list command &lt;tt&gt;ls&lt;/tt&gt; covers just about the whole alphabet when    it comes to command line options. The &lt;tt&gt;find&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;command, however, uses    abbreviations for options instead of letters and almost looks like a new language.    Most commands require a &lt;b&gt;"-" &lt;/b&gt;to delineate different arguments; others    do not. Several commands use subtly different dialects of regular expressions&lt;b&gt;    &lt;/b&gt;(wildcards).&lt;/p&gt;    &lt;p&gt;There are also frequently two versions of the same command: one from the System    V world and one from the BSD world. My favorite example of this is the &lt;tt&gt;mail&lt;/tt&gt;&lt;b&gt;    &lt;/b&gt;command&lt;b&gt;. &lt;/b&gt;The &lt;tt&gt;mail&lt;/tt&gt; command is a simple, text-based, virtually    feature-free mail reading and sending tool. There are two versions of this command    though, so there must have been something worth disagreeing about when it came time    to create the most basic of mail readers.&lt;/p&gt;    &lt;p&gt;Both &lt;tt&gt;mail&lt;/tt&gt; commands can be used to send e-mail from the command line and    are invaluable for unattended scripting jobs since they can alert administrators    of problems via e-mail. The BSD version allows you to specify a subject on the command    line, like this:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;mail -s "Backup Results" {hyperlink mailto:eric@niftydomain.com } &lt; backup.txt&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;where the &lt;tt&gt;-s&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;is an option for the mail subject. The System V version    of &lt;tt&gt;mail&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;(which is the default for Solaris) quietly ignores the &lt;b&gt;-&lt;/b&gt;&lt;tt&gt;s&lt;/tt&gt;    option. This has led to my actually troubleshooting why my mail had no subject on    at least three different occasions.&lt;/p&gt;    &lt;p&gt;Another endearing difference between the two major variants is the &lt;tt&gt;ps&lt;/tt&gt;&lt;b&gt;    &lt;/b&gt;command. Both commands provide the same information about running programs. The    command line arguments are completely different.&lt;/p&gt;    &lt;p&gt;The best way to avoid problems with these pointless and gratuitous differences    is to take full advantage of the wealth of information contained in the man pages.    (In the "Administration Resources" portion of this chapter we cover a few    ways to get more information from them.) And keep these tips in mind:    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;UNIX has been around for more than 25 years. What are the chances that you have     a problem that hasn't been solved by someone yet? Before you spend a lot of time     and effort solving a problem, spend some time reading man pages about the problem     and the tools you are using.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Many of the tools on a UNIX system have been around for those 25+ years. Software     that lasts that long must have something going for it.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Experiment with the tools and try to solve the same problem using different methods     every once in awhile. Sometimes you can pick up new tricks that will save you hours     of time in the future.    &lt;/li&gt;&lt;/ul&gt;    &lt;h2&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;System Administration Tasks&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;System administration can generally be divided into two broad categories: supporting    users and supporting systems.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Supporting Users&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;Users are your customers. Without them the network would be a single computer,    probably running a frivolous application like Doom and generating no business or    creating no new sales. (Sounds awful doesn't it?) We support users by creating their    logins and providing them with the information they need to use their computers to    get something done, without forcing them to become computer experts or addicts. (Like    us.)&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Creating User Accounts&lt;/b&gt; The most fundamental thing that an administrator    can do for a user is create her account. UNIX accounts are contained in the &lt;tt&gt;/etc/passwd&lt;/tt&gt;    file with the actual encrypted password being contained in either the &lt;tt&gt;passwd&lt;/tt&gt;    file or the &lt;tt&gt;/etc/shadow&lt;/tt&gt; file if the system implements shadow passwords.&lt;/p&gt;    &lt;p&gt;When a user is created, the account obviously has to be added to the &lt;tt&gt;passwd&lt;/tt&gt;    file. (The specifics behind user accounts are covered in Chapter 17, "User Administration.")    This is a very easy task that can be performed in less than a minute with any text    editor. However, if the UNIX version you are using has a tool for adding users, it    may not be a bad idea to just take advantage of it.&lt;/p&gt;    &lt;p&gt;These tools will frequently:    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Add the user to the &lt;tt&gt;passwd&lt;/tt&gt; file. (and shadow file if it is used) Since     all users require a unique user ID, letting the computer assign the number when you     are administering a large number of users can be very convenient.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Create a home directory for the user with the proper file permissions and ownership.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Copy generic &lt;i&gt;skeleton files&lt;/i&gt; to the account, which give the user a basic     environment to work with. These files can be created by the administrator, so the     paths to shared applications and necessary environment variables can be distributed     to users as they are created.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Register the new account with network systems, such as NIS and NFS, if the home     directory needs to be accessed on other hosts.    &lt;/li&gt;&lt;/ul&gt;    &lt;p&gt;So these tools can prevent common errors and save a bit of time. Most UNIX variants    also provide a command line tool named &lt;tt&gt;useradd&lt;/tt&gt; that will perform all or    most of these steps. If using the GUI tool is uncomfortable or unworkable, &lt;tt&gt;useradd&lt;/tt&gt;    can be incorporated into a shell or perl script.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Providing Support&lt;/b&gt; Providing users with documentation and support is another    key system administration task and potential headache. The best system administrator    is both invisible and never missed. She also realizes that expecting users to get    as excited about learning how to use a computer as she is is asking too much.&lt;/p&gt;    &lt;p&gt;A famous proverb talks about teaching a man to fish instead of buying him a McFish    sandwich. (Or something like that.) The idea behind this expression can be applied    to users with amazing results. However, few users will go out of their way to learn    how to use their systems. How can an administrator teach his users how to help themselves    without fighting a never ending battle?&lt;/p&gt;    &lt;p&gt;All user populations are different, and there is no universal solution to user    training, but here are a couple of ideas that may help.&lt;/p&gt;    &lt;p&gt;Try to provide and gently enforce a formal method for requesting changes to systems    and getting help. If users get accustomed to instant answers to questions, they will    become angry when you can't drop what you're doing to help them. Try to set up an    e-mail or Web-based help system. It may seem bureaucratic to force users to use these    systems, but it helps prevent your day from becoming "interrupt-driven"    and also provides you with a log of requests. (Have you ever forgotten to take care    of a request because you were too overloaded? Give yourself an automatic to do list.)&lt;/p&gt;    &lt;p&gt;Provide as much documentation as you can through easy-to-use interfaces, such    as Web browsers. The time you spend developing this information in user friendly    formats will be paid back in phone calls and conversations that never happen, and    may help you learn some more about your systems as you do it.&lt;/p&gt;    &lt;p&gt;If you have Internet access now, I'm sure your users spend hours glued to their    browsers; take advantage of that. You may also find that a lot of the information    your users need is already out there, so you may be able to link your users to some    of the information they need, without generating it yourself. (We'll go over some    of these resources later in the "Administration Resources" portion of this    chapter.)    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Supporting Systems&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;The other half of the job is supporting your systems. Systems have to be built,    backed up, upgraded, and, of course, fixed.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Adding Nodes&lt;/b&gt; A frequent system administration task is adding new nodes    to the network. It's also one of the parts of the job that can truly benefit from    some planning and insight.&lt;/p&gt;    &lt;p&gt;Not all systems are created equal, and not all of them are used for the same thing.    Spending some time understanding what your network is really used for and then applying    that to systems is key in network planning. Workstations should have well defined    roles and should be configured in accordance with those roles.&lt;/p&gt;    &lt;p&gt;When systems are designed and evaluated, some of the questions an administrator    can ask are:    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Will users be able to access all or some of the systems? Do users need to access     more than one system? Are there system that users should never access?     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;What network file systems will each workstation need to access? Are there enough     that &lt;tt&gt;automount&lt;/tt&gt; would help?     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;What network services, such as telnet, remote logins, sharing file systems, and     e-mail, do workstations need to provide? Can each service be justified?     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;What networks will workstations need to access? Are there networks that should     be inaccessible from others?    &lt;/li&gt;&lt;/ul&gt;    &lt;p&gt;These questions should help us develop a profile for each workstation. Following    a profile makes workstations easier to build, maintain, and troubleshoot, not to    mention making them more reliable since they tend to be less complex.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Backups&lt;/b&gt; Files get corrupted, lost, accidentally overwritten, or deleted.    Our only protection against these situations is backups, since UNIX does not have    an &lt;tt&gt;undelete&lt;/tt&gt; command.&lt;/p&gt;    &lt;p&gt;UNIX provides several backup tools, and deciding which tool(s) to use can be a    difficult.&lt;/p&gt;    &lt;p&gt;Earlier in the chapter we had an example of backing up a directory, using &lt;tt&gt;tar&lt;/tt&gt;&lt;b&gt;    &lt;/b&gt;and &lt;tt&gt;dd&lt;/tt&gt;&lt;b&gt;, &lt;/b&gt;to a remote tape drive. In that example, &lt;tt&gt;dd&lt;/tt&gt;&lt;b&gt;    &lt;/b&gt;was just be used as a way to copy a stream of data to a tape, while &lt;tt&gt;tar&lt;/tt&gt;    was the command actually performing the backup.&lt;/p&gt;    &lt;p&gt;&lt;tt&gt;tar&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;(&lt;b&gt;t&lt;/b&gt;ape &lt;b&gt;ar&lt;/b&gt;chive) is a commonly used backup tool.&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;tar -c -f /dev/rmt/0 /home/eric&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;The above command would back up the contents of the &lt;tt&gt;/home/eric&lt;/tt&gt; directory    to the first tape drive installed on a Solaris system. &lt;tt&gt;tar&lt;/tt&gt; automatically    traverses the directory, so all files in &lt;tt&gt;/home/eric&lt;/tt&gt; and its subdirectories    are archived.&lt;/p&gt;    &lt;p&gt;The device name for tape drives on systems differs from variant to variant. BSD    derivatives tend to refer to them as &lt;tt&gt;/dev/rst1&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;where 0 is the first,    1 is the second, and so on. (Linux, HP/UX, and SunOS 4.1.&lt;i&gt;x&lt;/i&gt; use this nomenclature.)    System V derivatives usually use &lt;tt&gt;/dev/rmt1&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;the same way. (AIX uses    this model.) However, Solaris 2.&lt;i&gt;x&lt;/i&gt;, which is System V based, adds a directory    to the path, so it is &lt;tt&gt;/dev/rmt/1&lt;/tt&gt;.&lt;/p&gt;    &lt;p&gt;The &lt;tt&gt;-f&lt;/tt&gt; option tells &lt;tt&gt;tar&lt;/tt&gt; which tape drive to use, while the &lt;tt&gt;-c&lt;/tt&gt;    option is telling it to create a new archive instead of modifying an existing one.    One of tar's idiosyncrasies is that when a path is given to it as the back up specification,    it is added to the archive, so when it time to restore &lt;tt&gt;/home/eric&lt;/tt&gt;, that    is where it will be restored to. A more flexible way to back up the directory is    to do this:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;cd /home/eric&lt;br /&gt;tar -cf /dev/rmt/0 .&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;Tar recognizes &lt;tt&gt;.&lt;/tt&gt; as meaning backup the current directory. When the archive    is extracted, it will be placed in the current directory, regardless of where that    is.&lt;/p&gt;    &lt;p&gt;&lt;tt&gt;cpio&lt;/tt&gt; is another standard UNIX tool for backups. Its interface is a little    more difficult than tar's, but has several advantages.&lt;/p&gt;    &lt;p&gt;&lt;tt&gt;cpio&lt;/tt&gt; is usually used with &lt;tt&gt;ls&lt;/tt&gt; or &lt;tt&gt;find&lt;/tt&gt; to create archives.&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;find . -print | cpio -o &gt; /dev/rst0&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;The &lt;tt&gt;find&lt;/tt&gt; command prints the full path of all of the files in its current    directory to standard out. &lt;tt&gt;cpio&lt;/tt&gt; accepts these filenames and archives them    to standard output. This is redirected to the tape, where it is archived. This command    is an excellent example of the UNIX way of combining commands to create a new tool.&lt;/p&gt;    &lt;p&gt;&lt;tt&gt;find&lt;/tt&gt; is a tool for finding files. They can be located by name, size,    creation date, modification date, and a whole universe of other criteria too extensive    to cover here. (As always, see the man page!) This example takes this tool for locating    files and makes it the user interface to our backup system.&lt;/p&gt;    &lt;p&gt;&lt;tt&gt;cpio&lt;/tt&gt; is the file copying and archiving "Swiss Army Knife."    In addition to streaming files in a format suitable for tape it can:    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Backup special files, such as device drive &lt;i&gt;stubs&lt;/i&gt; like &lt;tt&gt;/dev/rst0&lt;/tt&gt;.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Place data on tapes more efficiently than &lt;tt&gt;tar&lt;/tt&gt; or &lt;tt&gt;dd&lt;/tt&gt;.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Skip over bad areas on tapes or floppies when restoring, when &lt;tt&gt;tar&lt;/tt&gt; would     simply die. With &lt;tt&gt;cpio&lt;/tt&gt;, you can at least restore part of a damaged archive.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Perform backups to floppies, including spread a single archive over more than     one disk. &lt;tt&gt;tar&lt;/tt&gt; can only put a single archive on one disk.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Swap bytes during the archive or extraction in order to aid in transferring files     from one architecture to another.    &lt;/li&gt;&lt;/ul&gt;    &lt;p&gt;This example also illustrates how we can redirect standard output to a device    name and expect the device driver to place it on the device.&lt;/p&gt;    &lt;p&gt;Our example could also be stretched into a full-featured backup system. Since    &lt;tt&gt;find&lt;/tt&gt; allows us to pick files based on creation and modification dates, we    could perform a full backup to tape once a week by telling find to name all files,    and perform incremental backups to floppy every other day. The UNIX command line    is a very powerful tool, especially since programs have been designed for it steadily    during the past three decades.&lt;/p&gt;    &lt;p&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Solaris&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;   There are other backup tools, most notably &lt;tt&gt;dump &lt;/tt&gt;or &lt;tt&gt;ufsdump&lt;/tt&gt; as it    is named on Solaris 2.x. These tools are oriented toward backing up entire disk partitions,    instead of files. They are covered in Chapter 28, "Backing Up and Restoring    Your System."&lt;/p&gt;    &lt;p&gt;Larger sites with more comprehensive backup requirements may need a commercial    package. Legato's &lt;i&gt;NetWorker&lt;/i&gt; provides an advanced backup and restore system    that support the automated and unattended backup of UNIX systems, Windows and NT    workstations, Macintosh PCs and even database servers. The process of scheduling    backups, selecting file for backup and confirming the integrity of archives is all    done automatically. Restoring files and file systems is also very simple due to the    GUI.&lt;/p&gt;    &lt;p&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Solaris&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;br /&gt;   &lt;/b&gt;Sun bundles NetWorker with the Solaris 2.x server edition.&lt;/p&gt;    &lt;p&gt;Just as important as picking a backup tool is designing a backup strategy.&lt;/p&gt;    &lt;p&gt;Backing up the entire system daily is not acceptable, since it would take too    long and would be too ponderous to restore if only one file is needed.&lt;/p&gt;    &lt;p&gt;Here is another area where it pays to know your users and understand their business.    It's also important to design the network with backup and recovery in mind.    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Do the users have important files that they modify daily?     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Are the users clustered into one of two directories on one system, or will systems     have to be backed up across the network?     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;If only a single file has to be restored, will it have to be done quickly? Will     our current backup system allow us to find one file.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;How often and for how long are users not using the system? (It is better to back     up directories when they are not in use.)    &lt;/li&gt;&lt;/ul&gt;    &lt;p&gt;Depending on the requirements, a commercial backup tool may be a good investment.    The commercial tools, such as NetWorker, do excel in allowing you to locate and restore    one specific file quickly, which may be necessary in your situation.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;System Load and Performance&lt;/b&gt; The task of monitoring system load and system    performance falls on the shoulders of the system administrator. This is yet another    area where planning and anticipation are superior to waiting for something to happen    and reacting to it.&lt;/p&gt;    &lt;p&gt;Daily monitoring of usage statistics is a good idea, especially on mission-critical    systems and systems that users interact with regularly, such as Web servers and X    displays. These statistics can be gathered with automated scripts.&lt;/p&gt;    &lt;p&gt;Some of the things to monitor are disk usage, CPU utilization, swap, and memory.    The tools used for getting this information, such as &lt;tt&gt;du&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;and &lt;tt&gt;df&lt;/tt&gt;&lt;b&gt;    &lt;/b&gt;for disk information and &lt;tt&gt;top&lt;/tt&gt; and &lt;tt&gt;vmstat&lt;/tt&gt; for the rest, are covered    in the next few chapters in Part III.    &lt;/p&gt;&lt;h2&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Administration Resources&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;A system administrator needs every shred of information and help he can get, and    as much as UNIX vendors would hate to admit, the documentation that accompanies is    sometimes lacking. Fortunately, it's a big world out there.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;The Manual Pages&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;The famous rejoinder RTFM&lt;b&gt; &lt;/b&gt;(Read The Fine Manual) refers to the manual pages    installed on (hopefully) every UNIX system. The man pages, as they are frequently    called, contain documentation and instructions on just about every UNIX command,    C function call and data file on your system.&lt;/p&gt;    &lt;p&gt;The man command searches for documentation based on a command or topic name. So    the command&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;man ls&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;provides us with documentation on the &lt;tt&gt;ls&lt;/tt&gt; command, which happens to be    in section one.&lt;/p&gt;    &lt;p&gt;As simple as they may appear, the man pages actually have a sophisticated structure.    The pages are divided into sections, with some of the sections being further divided    into subsections.&lt;/p&gt;    &lt;p&gt;The section layout resembles this:    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;User commands--commands like &lt;tt&gt;ls&lt;/tt&gt;, &lt;tt&gt;tar&lt;/tt&gt;, and &lt;tt&gt;cpio&lt;/tt&gt;.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;System calls--C programming functions that are considered system calls, like     opening and closing files.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;C library functions--C programming functions that are not considered system calls,     like printing text.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;File formats--descriptions of file layouts, such as &lt;tt&gt;hosts.equiv&lt;/tt&gt; and     &lt;tt&gt;inetd.conf&lt;/tt&gt;.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Headers, Tables and Macros--miscellaneous documentation, such as character sets     and header files, not already covered.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Games and Demos--games and demo software. (Even Doom for UNIX has a man page!)    &lt;/li&gt;&lt;/ul&gt;    &lt;p&gt;This is a generalized table of contents. BSD and System V started out with slightly    different section schemes, and vendors tend to add their own sections and make their    own "improvements." (How could it be any other way?)&lt;/p&gt;    &lt;p&gt;In order to view information about each section, we can view the intro page for    it. In order to see information about section one, we would execute the following    command.&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;man -s 1 intro&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;The &lt;tt&gt;-s&lt;/tt&gt; option selects which section of the man pages to search with the    System V version of the &lt;tt&gt;man&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;command.&lt;b&gt; &lt;/b&gt;BSD versions accept the    section number as the first argument with no switch, while the Linux version will    select the section from an environment variable or from a &lt;tt&gt;-s&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;option.&lt;/p&gt;    &lt;p&gt;All of the versions accept the &lt;tt&gt;-a&lt;/tt&gt; option, which will force the &lt;tt&gt;man&lt;/tt&gt;    command to search all of the sections and display all pages that match. Since there    are different pages with the same name, understanding the different sections and    what belongs in each of them is helpful. However, there are additional tools, and    it is not necessary to memorize the section layout for each system.&lt;/p&gt;    &lt;p&gt;Man pages can be indexed and pre-formatted with a tool called &lt;tt&gt;catman&lt;/tt&gt;&lt;b&gt;.&lt;/b&gt;    The pre-formatting part make the pages display faster and is less important than    the indexing, which allows us to use more powerful information retrieval tools, namely    &lt;tt&gt;whatis&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;and&lt;b&gt; &lt;/b&gt;&lt;tt&gt;apropos&lt;/tt&gt;.&lt;/p&gt;    &lt;p&gt;&lt;tt&gt;apropos&lt;/tt&gt; displays the section number, name and short description of any    page that contains the specified keyword. &lt;tt&gt;whatis&lt;/tt&gt; gives us the man page name    and section number.&lt;/p&gt;    &lt;p&gt;For example, let's try the &lt;tt&gt;apropos&lt;/tt&gt; command for the keyword &lt;tt&gt;nfs&lt;/tt&gt;:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;apropos nfs&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;A portion of the response would be this:&lt;/p&gt;    &lt;p&gt;    &lt;table border="1"&gt;     &lt;tbody&gt;&lt;tr rowspan="1" align="left"&gt;      &lt;td valign="top" align="left"&gt;automount (8)&lt;/td&gt;      &lt;td valign="top" align="left"&gt;Automatically mount NFS file systems&lt;/td&gt;     &lt;/tr&gt;     &lt;tr rowspan="1" align="left"&gt;      &lt;td valign="top" align="left"&gt;exportfs (8)&lt;/td&gt;      &lt;td valign="top" align="left"&gt;Export and unexport directories to NFS clients&lt;/td&gt;     &lt;/tr&gt;     &lt;tr rowspan="1" align="left"&gt;      &lt;td valign="top" align="left"&gt;exports, xtab (5)&lt;/td&gt;      &lt;td valign="top" align="left"&gt;Directories to export to NFS clients&lt;/td&gt;     &lt;/tr&gt;     &lt;tr rowspan="1" align="left"&gt;      &lt;td valign="top" align="left"&gt;nfs, NFS (4P)&lt;/td&gt;      &lt;td valign="top" align="left"&gt;Network file system&lt;/td&gt;     &lt;/tr&gt;     &lt;tr rowspan="1" align="left"&gt;      &lt;td valign="top" align="left"&gt;nfsd, biod (8)&lt;/td&gt;      &lt;td valign="top" align="left"&gt;NFS daemons&lt;/td&gt;     &lt;/tr&gt;    &lt;/tbody&gt;&lt;/table&gt; (The output was edited, because the actual request returned 12 responses.)&lt;/p&gt;    &lt;p&gt;Now let's try &lt;tt&gt;whatis&lt;/tt&gt;:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;whatis nfs&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;nfs, NFS (4P) Network file system&lt;/p&gt;    &lt;p&gt;With &lt;tt&gt;whatis&lt;/tt&gt; we only see the name of the actual &lt;tt&gt;nfs&lt;/tt&gt; manual page    and its section number.&lt;/p&gt;    &lt;p&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Solaris&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;br /&gt;   &lt;/b&gt;In addition to the manual pages, Sun supplies &lt;i&gt;Answerbook&lt;/i&gt; with Solaris.    It's a GUI based online help system that supports full text search and just about    completely removes the need for hard copy documentation.&lt;/p&gt;    &lt;p&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;AIX&lt;br /&gt;   &lt;/b&gt;&lt;/span&gt;IBM supplies &lt;i&gt;Infoviewer&lt;/i&gt; which is also a GUI-based online help system.    As a matter of fact, the default AIX installation program installs Infoviewer instead    of the manual pages, which can be quite an inconvenience for users that do not use    X-windows.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Internet Information resources&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;The internet provides administrators with a wealth of resources too.    &lt;/p&gt;&lt;dl&gt;&lt;dd&gt;&lt;b&gt;1. Usenet News&lt;/b&gt;--While not as useful as it was in the past (due to overcrowding     and a plummeting signal to noise ratio) usenet news offers discussion groups about     all of the UNIX variants and covers various aspects of them. Some examples are &lt;tt&gt;comp.sys.sun.admin&lt;/tt&gt;,&lt;b&gt;     &lt;/b&gt;&lt;tt&gt;comp.os.linux.setup&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;and &lt;tt&gt;comp.unix.admin&lt;/tt&gt;.&lt;b&gt; &lt;/b&gt;Because     of the high traffic on usenet news, some sites do not carry it. If you cannot get     access, try using a search service such as &lt;tt&gt;http://www.dejanews.com&lt;/tt&gt; to find     what you need. Sometimes searching for articles that interest you instead of browsing     is a faster way to get what you need anyway. Dejanews offers searching and browsing.     &lt;p&gt;&lt;b&gt;2. FAQ Lists&lt;/b&gt;--Frequently Asked Question Lists hold a wealth of information.     Most of the computer-related usenet groups have their own FAQ lists. They can be     found posted periodically in the groups and at the &lt;tt&gt;rtfm.mit.edu&lt;/tt&gt;&lt;b&gt; &lt;/b&gt;ftp     server. Many of the FAQS are also available in html format.&lt;/p&gt;     &lt;p&gt;&lt;b&gt;3. The Web&lt;/b&gt;--Documentation is available from the UNIX vendors and from people     and groups involved with Linux. Many users and developers also post a wealth of information     just to be helpful. Use the search services to get your research going. UNIX was     one of the first operating systems to colonize the Internet, and, as a result, there     is a huge number of UNIX users on it.    &lt;/p&gt;&lt;/dd&gt;&lt;/dl&gt;    &lt;p&gt;There is a large amount of documentation and help available free on the Internet,    and there is a lot more to be learned from seeking out an answer than simply paying    a consultant to tell you or leaning on someone else to do what has to be done for    you.    &lt;/p&gt;&lt;h2&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Tools of the Trade&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;A successful administrator takes full advantage of the tools provided with a UNIX    system. To the uninitiated, UNIX seems difficult and unwieldy, but once you get the    idea you'll never want to use another system.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;The Shell&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;Earlier, we demonstrated how &lt;tt&gt;cpio&lt;/tt&gt; uses the output of the &lt;tt&gt;find&lt;/tt&gt;    command to learn what files to archive. This was a demonstration of shell pipes,    which redirect the output of one command to another. We also used this to back up    files to a tape drive that is located on another host.&lt;/p&gt;    &lt;p&gt;We demonstrated mailing a file to a user on the command line using redirection,    which opens a file and passes it to a command as if it was provided in the command    line or typed in as a program requested it.&lt;/p&gt;    &lt;p&gt;UNIX shells also support sophisticated programming constructs, such as loops,    and provide comparison operators, such as equality, greater than, and less than.&lt;/p&gt;    &lt;p&gt;Shell programming is essential to system administration, especially as networks    grow larger and, as a result, more time consuming to maintain. File backups, adding    users and nodes, collecting usage statistics, and a whole host of other administrative    tasks are candidates for unattended scripts.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Perl and Other Automation Tools&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;Perl has become more and more popular over the past few years, and not without    good reason. Many tasks that would have required the use of C in the past can now    be done by a novice programmer in Perl. System administrators can benefit greatly    from a little working knowledge of this language, since it can be used for tasks    such as:    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Analyzing log files and alerting the administrator of trouble via e-mail or pager     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Automatically converting systems statistics into Web pages.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Automating the process of creating user accounts, adding and distributing automounter     maps, backing up systems, and creating html content.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Creating and communicating over network connections.    &lt;/li&gt;&lt;/ul&gt;    &lt;p&gt;These are only a few examples of what this language can do. Chapter 5, "Perl,"    in Volume 2 has in-depth coverage of Perl.&lt;/p&gt;    &lt;p&gt;Some other tools worth noting are TCL/TK, which most of the RedHat administrative    tools are written in and awk, which is covered extensively in Chapter 4, "Awk,"    of Volume 2.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Intranet Tools&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;As mentioned earlier, consider using intranet tools like Web servers and e-mail    to communicate with your users.&lt;/p&gt;    &lt;p&gt;There are many Web discussion and guest book applications, all written in perl,    that could be modified and used to allow customers to enter requests for support.    An internal home page could be used to announce scheduled outages and system enhancements.    The Web also allows you to link clients to vendor-provided support resources and    documentation.    &lt;/p&gt;&lt;h2&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;What is system administration? This chapter kind of meandered along and tried    to give you an idea of what administrators do and what they need to know.&lt;/p&gt;    &lt;p&gt;A literal attempt at answering the question may say that administrators are responsible    for:    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Understanding how the systems they are responsible interact over the office or     organizational LAN/WAN.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Supporting users by creating their accounts, protecting their data and making     their sometimes bewildering systems easier to use.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Supporting systems by keeping the secure, up to date and well tuned.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Planning the efforts behind support and growth.     &lt;p&gt;     &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Anticipating and resolving problems.    &lt;/li&gt;&lt;/ul&gt;    &lt;p&gt;But it may be better to generalize and say that system administration is the process    and effort behind supporting a system or systems so that a company or group can attain    its goals.&lt;/p&gt;    &lt;p&gt;The rest of this section delves much more deeply into the details of system support.    Chapters 15 and 16 describe how to install a UNIX system and start it up and shut    it down.&lt;/p&gt;    &lt;p&gt;In Chapter 17 we cover supporting users much more in-depth than was covered here.    Chapter 18 covers file systems and disk configuration , while 19 provides coverage    on kernel configuration.&lt;/p&gt;    &lt;p&gt;Chapter 20 is where the complete coverage on UNIX networking is located. In Chapter    21 we cover system accounting, which is key for administrators who are concerned    with supported large groups of users or that need to come up with a comprehensive    system for charging users for access.&lt;/p&gt;     &lt;p&gt;For information on system performance and how to improve it, see Chapter 22. In    addition, Chapter 23 provides information on how to add and maintain new system components,    such as tape drives and modems.&lt;/p&gt;     &lt;p&gt;Managing mail, Usenet news and other network services is covered in Chapters 23    through 27. Our last chapter in this section, 28, covers system backup and restore.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/345201392220129351-2830626472936272837?l=unixfaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixfaq.blogspot.com/feeds/2830626472936272837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=345201392220129351&amp;postID=2830626472936272837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/2830626472936272837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/2830626472936272837'/><link rel='alternate' type='text/html' href='http://unixfaq.blogspot.com/2008/08/what-is-system-administration.html' title='What Is System Administration?'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-345201392220129351.post-3694432201148581818</id><published>2008-08-28T23:57:00.001-07:00</published><updated>2008-12-23T00:12:05.690-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What Is a Shell?</title><content type='html'>&lt;h1 align="center"&gt;&lt;span style="color:#000077;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h1&gt;       &lt;p&gt;&lt;i&gt;By William A. Farra&lt;/i&gt;&lt;/p&gt;    &lt;p&gt;Nearly every human-usable invention has an interface point with which you interact.    Whether you are in the front seat of a horse and buggy, in the cockpit of a plane,    or at the keyboard of a piano, this position is where you manipulate and manage the    various aspects of the invention to achieve a desired outcome. The human interface    point for UNIX is the &lt;i&gt;shell,&lt;/i&gt; which is a program layer that provides you with    an environment in which to enter commands and parameters to produce a given result.    As with any invention, the more knowledge and experience you have with it, the greater    the accomplishment you make with it.&lt;/p&gt;    &lt;p&gt;To meet varying needs, UNIX has provided different shells. Discussed in Chapters    9 through 13 are Bourne, Bourne Again, Korn, and C shells. Each of these offers features    and ways to interact with UNIX. Topics discussed in this chapter are the following:    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;How shells works with you and UNIX     &lt;/li&gt;&lt;li&gt;The features of a shell     &lt;/li&gt;&lt;li&gt;Manipulating the shell environment    &lt;/li&gt;&lt;/ul&gt;    &lt;h2&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;How the Kernel and the Shell Interact&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;When a UNIX system is brought online, the program &lt;tt&gt;unix&lt;/tt&gt; (the Kernel) is    loaded into the computer's main memory, where it remains until the computer is shut    down. During the bootup process, the program &lt;tt&gt;init&lt;/tt&gt; runs as a background task    and remains running until shutdown. This program scans the file &lt;tt&gt;/etc/inittab&lt;/tt&gt;,    which lists what ports have terminals and their characteristics. When an active,    open terminal is found, &lt;tt&gt;init&lt;/tt&gt; calls the program &lt;tt&gt;getty&lt;/tt&gt;, which issues    a &lt;tt&gt;login:&lt;/tt&gt; prompt to the terminal's monitor. With these processes in place    and running, the user is ready to start interacting with the system.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;UNIX Calls the Shell at Login&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;Figure 8.1 shows the process flow from the kernel through the login process. At    this point the user is in an active shell, ready to give command to the system.&lt;/p&gt;    &lt;p&gt;&lt;a href="file:///E:/Thangs/Study/Unix/unix%5B1%5D.zip/art/08/08uni01.jpg"&gt;&lt;b&gt;Figure 8.1.&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;   &lt;i&gt;How a shell is started from login.&lt;/i&gt;&lt;/p&gt;    &lt;p&gt;During login, when you type your user name, &lt;tt&gt;getty&lt;/tt&gt; issues a &lt;tt&gt;password:&lt;/tt&gt;    prompt to the monitor. After you type your password, &lt;tt&gt;getty&lt;/tt&gt; calls &lt;tt&gt;login&lt;/tt&gt;,    which scans for a matching entry in the file &lt;tt&gt;/etc/passwd&lt;/tt&gt;. If a match is    made, &lt;tt&gt;login&lt;/tt&gt; proceeds to take you to your home directory and then passes    control to a session startup program; both the user name and password are specified    by the entry in &lt;tt&gt;/etc/passwd&lt;/tt&gt;. Although this might be a specific application    program, such as a menu program, normally the session startup program is a shell    program such as &lt;tt&gt;/bin/sh&lt;/tt&gt;, the Bourne shell.&lt;/p&gt;    &lt;p&gt;From here, the shell program reads the files &lt;tt&gt;/etc/profile&lt;/tt&gt; and &lt;tt&gt;.profile&lt;/tt&gt;,    which set up the system-wide and user-specific environment criteria. At this point,    the shell issues a command prompt such as &lt;tt&gt;$&lt;/tt&gt;.&lt;/p&gt;    &lt;p&gt;When the shell is terminated, the kernel returns control to the init program,    which restarts the login process. Termination can happen in one of two ways: with    the &lt;tt&gt;exit&lt;/tt&gt; command or when the kernel issues a kill command to the shell process.    At termination, the kernel recovers all resources used by the user and the shell    program.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;The Shell and Child Processes&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;In the Unix system, there are many layers of programs starting from the kernel    through a given application program or command. The relationship of these layers    is represented in Figure 8.2.&lt;/p&gt;    &lt;p&gt;&lt;a href="file:///E:/Thangs/Study/Unix/unix%5B1%5D.zip/art/08/08uni02.jpg"&gt;&lt;b&gt;Figure 8.2.&lt;/b&gt;&lt;/a&gt; &lt;i&gt;&lt;br /&gt;   UNIX system layers.&lt;/i&gt;&lt;/p&gt;    &lt;p&gt;After you finish logging on, the shell program layer is in direct contact with    the kernel, as shown in Figure 8.2. As you type a command such as &lt;tt&gt;$ ls&lt;/tt&gt;,    the shell locates the actual program file, &lt;tt&gt;/bin/ls&lt;/tt&gt;, and passes it to the    kernel to execute. The kernel creates a new child process area, loads the program,    and executes the instructions in &lt;tt&gt;/bin/ls&lt;/tt&gt;. After program completion, the    kernel recovers the process area and returns control to the parent shell program.    To see an example of this, type the following command:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ps&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;This lists the processes you are currently running. You will see the shell program    and the &lt;tt&gt;ps&lt;/tt&gt; program. Now type the following:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$sleep 10 &amp;amp;&lt;br /&gt;$ps&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;The first command creates a &lt;tt&gt;sleep&lt;/tt&gt; child process to run in background,    which you see listed with the &lt;tt&gt;ps&lt;/tt&gt; command. Whenever you enter a command,    a child process is created and independently executes from the parent process or    shell. This leaves the parent intact to continue other work.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Auto-Execution of the Shell&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;Some UNIX resources, such as &lt;tt&gt;cron&lt;/tt&gt;, can execute a shell program without    human interaction. When using this feature, the user needs to specify which shell    to run in the first line of the shell program, like this:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;#! /bin/sh&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;This specifies the Bourne shell.&lt;/p&gt;    &lt;p&gt;You should also redirect any output, because no terminal is associated with auto-execution.    This is described in the "File Handling: Input/Output Redirection and Pipes"    section later in this chapter.    &lt;/p&gt;&lt;h2&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;The Functions and Features of a Shell&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;It doesn't matter which of the standard shells you choose, because they all have    the same purpose: to provide a user interface to UNIX. To provide this interface,    all the shells offer the same basic characteristics:    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Command-line interpretation     &lt;/li&gt;&lt;li&gt;Reserved words     &lt;/li&gt;&lt;li&gt;Shell meta-characters (wild cards)     &lt;/li&gt;&lt;li&gt;Access to and handling of program commands     &lt;/li&gt;&lt;li&gt;File handling: input/output redirection and pipes     &lt;/li&gt;&lt;li&gt;Maintenance of variables     &lt;/li&gt;&lt;li&gt;Environment control     &lt;/li&gt;&lt;li&gt;Shell programming    &lt;/li&gt;&lt;/ul&gt;    &lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Command-Line Interpretation&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;When you log in, starting a special version of a shell called an &lt;i&gt;interactive    shell,&lt;/i&gt; you see a shell prompt, usually in the form of a dollar sign (&lt;tt&gt;$&lt;/tt&gt;),    a percent sign (&lt;tt&gt;%&lt;/tt&gt;), or a pound sign (&lt;tt&gt;#&lt;/tt&gt;). When you type a line of    input at a shell prompt, the shell tries to interpret it. Input to a shell prompt    is sometimes called a &lt;i&gt;command line.&lt;/i&gt; The basic format of a command line is&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;command arguments&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;&lt;i&gt;&lt;tt&gt;command&lt;/tt&gt;&lt;/i&gt; is an executable UNIX command, program, utility, or shell    program. &lt;i&gt;&lt;tt&gt;arguments&lt;/tt&gt;&lt;/i&gt; are passed to the executable. Most UNIX utility    programs expect &lt;i&gt;&lt;tt&gt;arguments&lt;/tt&gt;&lt;/i&gt; to take the following form:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;options filenames&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;For example, in the command line&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ ls -l file1 file2&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;there are three arguments to &lt;tt&gt;ls&lt;/tt&gt;; the first is an option, and the last    two are filenames.&lt;/p&gt;    &lt;p&gt;One of the things the shell does for the kernel is to eliminate unnecessary information.    For a computer, one type of unnecessary information is whitespace; therefore, it    is important to know what the shell does when it sees whitespace. Whitespace consists    of space characters, horizontal tabs, and newline characters. Consider this example:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ echo part A     part B     part C&lt;br /&gt;part A part B part C&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;Here, the shell has interpreted the command line as the &lt;tt&gt;echo&lt;/tt&gt; command    with six arguments and has removed the whitespace between the arguments. For example,    if you were printing headings for a report and wanted to keep the whitespace, you    would have to enclose the data in quotation marks, as in&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ echo 'part A     part B     part C'&lt;br /&gt;part A     part B     part C&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;The single quotation mark prevents the shell from looking inside the quotes. Now    the shell interprets this line as the &lt;tt&gt;echo&lt;/tt&gt; command with a single argument,    which happens to be a string of characters including whitespace.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Reserved Words&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;All shell versions have words that have special meaning. In shell programming,    words such as &lt;tt&gt;do&lt;/tt&gt;, &lt;tt&gt;done&lt;/tt&gt;, &lt;tt&gt;for&lt;/tt&gt;, and &lt;tt&gt;while&lt;/tt&gt; provide    loop control--and &lt;tt&gt;if&lt;/tt&gt;, &lt;tt&gt;then&lt;/tt&gt;, &lt;tt&gt;else&lt;/tt&gt;, and &lt;tt&gt;fi&lt;/tt&gt; provide    conditional control. Each shell version has different reserved word pertaining to    its specific features.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Shell Meta-Character (Wild Cards)&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;All shell versions have meta-characters, which allow the user to specify filenames.    The following are wild cards:     &lt;table border="1"&gt;     &lt;tbody&gt;&lt;tr&gt;      &lt;td&gt;&lt;i&gt;Wild Card&lt;/i&gt;&lt;/td&gt;      &lt;td&gt;&lt;i&gt;Description&lt;/i&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr rowspan="1" align="left"&gt;      &lt;td align="left"&gt;&lt;tt&gt;*&lt;/tt&gt;&lt;/td&gt;      &lt;td align="left"&gt;Matches any portion&lt;/td&gt;     &lt;/tr&gt;     &lt;tr rowspan="1" align="left"&gt;      &lt;td align="left"&gt;&lt;tt&gt;?&lt;/tt&gt;&lt;/td&gt;      &lt;td align="left"&gt;Matches any single character&lt;/td&gt;     &lt;/tr&gt;     &lt;tr rowspan="1" align="left"&gt;      &lt;td align="left"&gt;&lt;tt&gt;[]&lt;/tt&gt;&lt;/td&gt;      &lt;td align="left"&gt;Matches a range or list of characters&lt;/td&gt;     &lt;/tr&gt;    &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;    &lt;p&gt;Wild cards can be useful when processing a number of specific files. The following    are some examples:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ls t*&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;This lists all files starting with &lt;tt&gt;t&lt;/tt&gt;.&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ls test?5.dat&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;This lists all files starting with &lt;tt&gt;test,&lt;/tt&gt; any single character and ends    with &lt;tt&gt;5.dat&lt;/tt&gt;.&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ls [a-c]*&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;This lists all files starting with &lt;tt&gt;a&lt;/tt&gt; through &lt;tt&gt;c&lt;/tt&gt;.&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ls [e,m,t]*&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;This lists all files starting with &lt;tt&gt;e&lt;/tt&gt;, &lt;tt&gt;m&lt;/tt&gt;, or &lt;tt&gt;t&lt;/tt&gt;.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Program Commands&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;When a command is typed, the shell reads the environment variable &lt;tt&gt;$path&lt;/tt&gt;,    which contains a list of directories containing program files. The shell looks through    this set of directories to find the program file for the command. The shell then    passes the true filename to the kernel.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;File Handling: Input/Output Redirection and Pipes&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;In previous chapters, you learned about standard input and output. Unless otherwise    specified with arguments, most UNIX commands take input from the terminal keyboard    and send output to the terminal monitor. To redirect output to a file, use the &lt;tt&gt;&gt;&lt;/tt&gt;    symbol. For example,&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ls &gt; myfiles&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;lists the files in your current directory and places them in a file called &lt;tt&gt;myfiles&lt;/tt&gt;.    Likewise, you can redirect input with the &lt;tt&gt;&lt;&lt;/tt&gt; symbol. For example,&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$wc -l &lt; myfiles&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;feeds the command &lt;tt&gt;wc&lt;/tt&gt; with input from the file &lt;tt&gt;myfiles&lt;/tt&gt;. Although    you could obtain the same output by having the filename as an argument, the need    for input redirection becomes more apparent in shell programming.&lt;/p&gt;    &lt;p&gt;To string the output from one command to the input of the next command, you can    use the &lt;tt&gt;|&lt;/tt&gt; (pipe) symbol. For example,&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ls -s | sort -nr | pg&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;This lists the files in the current directory with blocksize and then pipes the    output to the &lt;tt&gt;sort&lt;/tt&gt;, which sorts the files in numeric descending order and    pipes that output to the paging command &lt;tt&gt;pg&lt;/tt&gt; for final display on the terminal's    monitor. The pipe command is one of the most useful tools when creating command constructs.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Command Substitution&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;Command substitution is similar to redirection except that is used to provide    arguments to a command from the output of another. For example,&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$grep 'wc -l myfiles' *&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;takes the number of lines in the file &lt;tt&gt;myfiles&lt;/tt&gt; from the &lt;tt&gt;wc&lt;/tt&gt; command    and places the number as an argument to the &lt;tt&gt;grep&lt;/tt&gt; command to search all files    in the current directory for that number.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Maintenance of Variables&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;The shell is capable of maintaining variables. &lt;i&gt;Variables&lt;/i&gt; are places you    can store data for later use. You assign a value to a variable with an equal (&lt;tt&gt;=&lt;/tt&gt;)    sign:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ LOOKUP=/usr/mydir&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;Here, the shell establishes &lt;tt&gt;LOOKUP&lt;/tt&gt; as a variable and assigns it the value    &lt;tt&gt;/usr/mydir&lt;/tt&gt;. Later, you can use the value stored in &lt;tt&gt;LOOKUP&lt;/tt&gt; in a    command line by prefacing the variable name with a dollar sign (&lt;tt&gt;$&lt;/tt&gt;). Consider    these examples:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ echo $LOOKUP&lt;br /&gt;/usr/mydir&lt;br /&gt;$ echo LOOKUP&lt;br /&gt;LOOKUP&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;To make a variable available to child processes, you can use the &lt;tt&gt;export&lt;/tt&gt;    command--for example:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ LOOKUP=/usr/mydir&lt;br /&gt;$export LOOKUP&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;      &lt;blockquote&gt;    &lt;p&gt; &lt;/p&gt;&lt;hr /&gt; &lt;span style="color:#000077;"&gt;&lt;b&gt;NOTE:&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;Assigning values to variables in    the C shell differs from doing so in the Bourne and Korn shells. To assign a variable    in the C-shell, use the &lt;tt&gt;set&lt;/tt&gt; command:    &lt;p&gt;&lt;span style="color:#0066ff;"&gt;&lt;tt&gt;% set LOOKUP = /usr/mydir&lt;/tt&gt;&lt;/span&gt;     &lt;/p&gt;&lt;/blockquote&gt;           &lt;blockquote&gt;    &lt;p&gt;Notice that spaces precede and follow the equal sign.  &lt;/p&gt;&lt;hr /&gt;      &lt;/blockquote&gt;     &lt;p&gt;Like filename substitution, variable name substitution happens before the program    call is made. The second example omits the dollar sign (&lt;tt&gt;$&lt;/tt&gt;). Therefore, the    shell simply passes the string to &lt;tt&gt;echo&lt;/tt&gt; as an argument. In variable name    substitution, the value of the variable replaces the variable name.&lt;/p&gt;    &lt;p&gt;For example, in&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ ls $LOOKUP/filename&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;the &lt;tt&gt;ls&lt;/tt&gt; program is called with the single argument &lt;tt&gt;/&lt;i&gt;usr&lt;/i&gt;/&lt;i&gt;mydir&lt;/i&gt;/&lt;i&gt;filename&lt;/i&gt;&lt;/tt&gt;.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Shell Startup--Environment Control&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;When a user begins a session with UNIX and the shell is executed, the shell creates    a specified environment for the user. The following sections describe these processes.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Shell Environment Variables&lt;/b&gt; When the login program invokes your shell,    it sets up your environment variables, which are read from the shell initialization    files &lt;tt&gt;/etc/profile&lt;/tt&gt; and &lt;tt&gt;.profile&lt;/tt&gt;. These files normally set the type    of terminal in the variable &lt;tt&gt;$TERM&lt;/tt&gt; and the default path that is searched    for executable files in the variable &lt;tt&gt;$PATH&lt;/tt&gt;. Try these examples:&lt;/p&gt;    &lt;pre&gt;&lt;span style="color:#0066ff;"&gt;$ echo $TERM&lt;br /&gt;$ echo $PATH&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;p&gt;You can easily change the variables the same way you assign values to any shell    variable.&lt;/p&gt;      &lt;blockquote&gt;    &lt;p&gt; &lt;/p&gt;&lt;hr /&gt; &lt;span style="color:#000077;"&gt;&lt;b&gt;NOTE:&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;C shell assigns values to environment    variables using the &lt;tt&gt;setenv&lt;/tt&gt; command:    &lt;p&gt;&lt;span style="color:#0066ff;"&gt;&lt;tt&gt;% setenv TERM vt100&lt;/tt&gt;&lt;/span&gt;  &lt;/p&gt;&lt;hr /&gt;      &lt;/blockquote&gt;     &lt;p&gt;&lt;b&gt;Shell Startup Files&lt;/b&gt; The file &lt;tt&gt;.profile&lt;/tt&gt; is the local startup file    for the Bourne shell. The Korn shell uses &lt;tt&gt;.kshrc&lt;/tt&gt;, and the C shell uses &lt;tt&gt;.cshrc&lt;/tt&gt;.    You can edit these files to manipulate your startup environment. You can add additional    variables as the need arises. You also can add shell programming to have conditional    environment settings, if necessary.&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Shell Startup Options&lt;/b&gt; When invoking the shell either from &lt;tt&gt;/etc/passwd&lt;/tt&gt;    or the command line, you can set several options as arguments to the shell program.    For example, the Bourne shell has a &lt;tt&gt;-x&lt;/tt&gt; option that displays commands and    their arguments before they are executed. This is useful for debugging a shell program.    These options are described in detail in the following chapters.    &lt;/p&gt;&lt;h3&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Shell Programming&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;p&gt;You've seen that the shell is used to interpret command lines, maintain variables,    and execute programs. The shell is also a programming language. You can store a set    of shell commands in file. This is known as a &lt;i&gt;shell script&lt;/i&gt; or &lt;i&gt;shell programming.&lt;/i&gt;    By combining commands and variable assignments with flow control and decision making,    you have a powerful programming tool. Using the shell as a programming language,    you can automate recurring tasks, write reports, and build and manipulate your own    data files. The remaining chapters in Part II discuss shell programming in more detail.    &lt;/p&gt;&lt;h2&gt;&lt;span style="color:#000077;"&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;The shell provides an interface between the user and the heart of UNIX--the kernel.    The shell interprets command lines as input, makes filename and variable substitution,    redirects input and output, locates the executable file, and initiates and interfaces    programs. The shell creates child processes and can manage their execution. The shell    maintains each user's environment variables. The shell is also a powerful programming    language.&lt;/p&gt;     &lt;p&gt;While this chapter gives an overview of the UNIX shell, Chapters 9 through 13    describe in detail the various shells, their features, and language specifics. Also    described are the fundamentals of shell programming and execution. Continued reading    is highly recommended.  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/345201392220129351-3694432201148581818?l=unixfaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixfaq.blogspot.com/feeds/3694432201148581818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=345201392220129351&amp;postID=3694432201148581818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/3694432201148581818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/3694432201148581818'/><link rel='alternate' type='text/html' href='http://unixfaq.blogspot.com/2008/08/what-is-shell.html' title='What Is a Shell?'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-345201392220129351.post-8013771163870507234</id><published>2008-08-28T23:55:00.001-07:00</published><updated>2008-12-23T00:12:05.690-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>Unix commands</title><content type='html'>cd  matlab         change to the subdirectory named matlab&lt;br /&gt;cd                 change to the home directory&lt;br /&gt;cp  file1  file2   make a copy of file1 called file2&lt;br /&gt;cp dir2/file1 .    copy file1 from directory dir2 into current directory&lt;br /&gt;echo $param        show idefinition of param&lt;br /&gt;env                show values of environment variables&lt;br /&gt;history            show previous commands by number&lt;br /&gt;lpr -Pworkman54 f1 print f1 (notice capital P)&lt;br /&gt;lpq -Pworkman54    look at printer queue for sage&lt;br /&gt;ls  *dwg           list names of all files ending in the letters dwg&lt;br /&gt;man  cp            learn more about cp command (manual)&lt;br /&gt;mkdir ansys        make a new directory called ansys (change to root&lt;br /&gt;                      first with cd command)&lt;br /&gt;more file1         look at file1 page by page (usually aliased to just m)&lt;br /&gt;mv file1 file2     move or rename file1 to file2&lt;br /&gt;pwd                show current directory name&lt;br /&gt;rm  *bak           remove all files ending in the letters bak&lt;br /&gt;abbr=orig          define abbreviation (usually shorter)&lt;br /&gt;tail -15  file1    look at last 15 lines of file1&lt;br /&gt;&lt;br /&gt;You can rerun previous commands and make changes with emacs commands:&lt;br /&gt;^P      redisplay previous command (then use commands to change it)&lt;br /&gt;^Rls    repeat most recent command that begins with ls&lt;br /&gt;!5  repeat command 5 (use history or h to find the command number)&lt;br /&gt;!^  first option of previous command&lt;br /&gt;!$  last option of previous command&lt;br /&gt;!*  all options of previous command&lt;br /&gt;!:2 second option of previous command&lt;br /&gt;&lt;br /&gt;Before erasing files, check that the parameters are correct. For example, first give:&lt;br /&gt;    ls  fname*      # list corresponding files&lt;br /&gt;    rm  !$          # erase those files&lt;br /&gt;&lt;br /&gt;To copy files from my class directory, define a short symbol a, then check th&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;rm': Remove files or directories&lt;br /&gt; =================================&lt;br /&gt;&lt;br /&gt;    `rm' removes each given FILE.  By default, it does not remove&lt;br /&gt; directories.  Synopsis:&lt;br /&gt;&lt;br /&gt;      rm [OPTION]... [FILE]...&lt;br /&gt;&lt;br /&gt;    If a file is unwritable, standard input is a terminal, and the `-f'&lt;br /&gt; or `--force' option is not given, or the `-i' or `--interactive' option&lt;br /&gt; _is_ given, `rm' prompts the user for whether to remove the file.  If&lt;br /&gt; the response does not begin with `y' or `Y', the file is skipped.&lt;br /&gt;&lt;br /&gt;    The program accepts the following options.  Also see XRef Common&lt;br /&gt; options.&lt;br /&gt;&lt;br /&gt; `-d'&lt;br /&gt; `--directory'&lt;br /&gt;      Remove directories with `unlink' instead of `rmdir', and don't&lt;br /&gt;      require a directory to be empty before trying to unlink it.  Only&lt;br /&gt;      works if you have appropriate privileges.  Because unlinking a&lt;br /&gt;      directory causes any files in the deleted directory to become&lt;br /&gt;      unreferenced, it is wise to `fsck' the filesystem after doing this.&lt;br /&gt;&lt;br /&gt; `-f'&lt;br /&gt; `--force'&lt;br /&gt;      Ignore nonexistent files and never prompt the user.  Ignore any&lt;br /&gt;      previous `--interactive' (`-i') option.&lt;br /&gt;&lt;br /&gt; `-i'&lt;br /&gt; `--interactive'&lt;br /&gt;      Prompt whether to remove each file.  If the response does not begin&lt;br /&gt;      with `y' or `Y', the file is skipped.  Ignore any previous&lt;br /&gt;      `--force' (`-f') option.&lt;br /&gt;&lt;br /&gt; `-r'&lt;br /&gt; `-R'&lt;br /&gt; `--recursive'&lt;br /&gt;      Remove the contents of directories recursively.&lt;br /&gt;&lt;br /&gt; `-v'&lt;br /&gt; `--verbose'&lt;br /&gt;      Print the name of each file before removing it.&lt;br /&gt;&lt;br /&gt;    One common question is how to remove files whose names begin with a&lt;br /&gt; `-'.  GNU `rm', like every program that uses the `getopt' function to&lt;br /&gt; parse its arguments, lets you use the `--' option to indicate that all&lt;br /&gt; following arguments are non-options.  To remove a file called `-f' in&lt;br /&gt; the current directory, you could type either:&lt;br /&gt;&lt;br /&gt;      rm -- -f&lt;br /&gt;&lt;br /&gt; or:&lt;br /&gt;&lt;br /&gt;      rm ./-f&lt;br /&gt;&lt;br /&gt;    The Unix `rm' program's use of a single `-' for this purpose&lt;br /&gt; predates the development of the getopt standard syntax.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Prev (fileutils) mv invocation Up (fileutils) Basic operations&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;automatically generated by info2html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;FTP Options&lt;br /&gt; ===========&lt;br /&gt;&lt;br /&gt; `--retr-symlinks'&lt;br /&gt;      Retrieve symbolic links on FTP sites as if they were plain files,&lt;br /&gt;      i.e. don't just create links locally.&lt;br /&gt;&lt;br /&gt; `-g on/off'&lt;br /&gt; `--glob=on/off'&lt;br /&gt;      Turn FTP globbing on or off.  Globbing means you may use the&lt;br /&gt;      shell-like special characters ("wildcards"), like `*', `?', `['&lt;br /&gt;      and `]' to retrieve more than one file from the same directory at&lt;br /&gt;      once, like:&lt;br /&gt;&lt;br /&gt;           wget ftp://gnjilux.cc.fer.hr/*.msg&lt;br /&gt;&lt;br /&gt;      By default, globbing will be turned on if the URL contains a&lt;br /&gt;      globbing character.  This option may be used to turn globbing on&lt;br /&gt;      or off permanently.&lt;br /&gt;&lt;br /&gt;      You may have to quote the URL to protect it from being expanded by&lt;br /&gt;      your shell.  Globbing makes Wget look for a directory listing,&lt;br /&gt;      which is system-specific.  This is why it currently works only&lt;br /&gt;      with Unix FTP servers (and the ones emulating Unix `ls' output).&lt;br /&gt;&lt;br /&gt; `--passive-ftp'&lt;br /&gt;      Use the "passive" FTP retrieval scheme, in which the client&lt;br /&gt;      initiates the data connection.  This is sometimes required for FTP&lt;br /&gt;      to work behind firewalls.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/345201392220129351-8013771163870507234?l=unixfaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixfaq.blogspot.com/feeds/8013771163870507234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=345201392220129351&amp;postID=8013771163870507234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/8013771163870507234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/8013771163870507234'/><link rel='alternate' type='text/html' href='http://unixfaq.blogspot.com/2008/08/unix-commands.html' title='Unix commands'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-345201392220129351.post-3499327250024111342</id><published>2008-08-12T04:59:00.000-07:00</published><updated>2008-12-23T00:12:05.690-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>Shell Scripting</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C06%5Cclip_filelist.xml"&gt;&lt;link rel="Edit-Time-Data" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C06%5Cclip_editdata.mso"&gt;&lt;!--[if !mso]&gt; &lt;style&gt; v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} &lt;/style&gt; &lt;![endif]--&gt;&lt;title&gt;© Moreniche&lt;/title&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="State"&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:documentproperties&gt;   &lt;o:author&gt;Marcus Polo&lt;/o:Author&gt;   &lt;o:version&gt;11.9999&lt;/o:Version&gt;  &lt;/o:DocumentProperties&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:usefelayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id="ieooui"&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Wingdings; 	panose-1:5 0 0 0 0 0 0 0 0 0; 	mso-font-alt:Wingdings; 	mso-font-charset:2; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:0 268435456 0 0 -2147483648 0;} @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:ËÎÌå; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:"\@Arial Unicode MS"; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} h1 	{mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	mso-outline-level:1; 	font-size:24.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US; 	font-weight:bold;} a:link, span.MsoHyperlink 	{color:blue; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{color:#606420; 	text-decoration:underline; 	text-underline:single;} p 	{mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} code 	{font-family:"Courier New"; 	mso-ascii-font-family:"Courier New"; 	mso-fareast-font-family:"Courier New"; 	mso-hansi-font-family:"Courier New"; 	mso-bidi-font-family:"Courier New";} pre 	{margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; 	font-size:10.0pt; 	font-family:"Courier New"; 	mso-fareast-font-family:"Courier New"; 	mso-fareast-language:EN-US;} tt 	{font-family:"Courier New"; 	mso-ascii-font-family:"Courier New"; 	mso-fareast-font-family:"Courier New"; 	mso-hansi-font-family:"Courier New"; 	mso-bidi-font-family:"Courier New";} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:715197189; 	mso-list-type:hybrid; 	mso-list-template-ids:92599426 -1188517740 -530799512 -598695272 899042700 1585353110 -1582956514 -586365152 -911154184 1473959580;} @list l0:level1 	{mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l1 	{mso-list-id:1766881187; 	mso-list-type:hybrid; 	mso-list-template-ids:273993362 982664326 986370680 -204317022 -317400724 -1397041012 -179270248 1650645040 1397247610 -267460948;} @list l1:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	mso-ansi-font-size:10.0pt; 	font-family:Symbol;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;    &lt;h1&gt;&lt;span style="font-size: 14pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;Variables in Shell&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;To process our data/information, data must be kept in computers RAM memory. RAM memory is divided into small locations, and each location had unique number called memory location/address, which is used to hold our data. Programmer can give a unique name to this memory location/address called memory variable or variable (Its a named storage location that may take different values, but only one at a time).&lt;/p&gt;  &lt;p&gt;In Shell, there are two types of variable:&lt;br /&gt;(1) &lt;b&gt;System variables&lt;/b&gt; - Created and maintained by Linux itself. This type of variable defined in CAPITAL LETTERS.&lt;br /&gt;(2) &lt;b&gt;User defined variables (UDV)&lt;/b&gt; - Created and maintained by user. This type of variable defined in lower letters.&lt;/p&gt;  &lt;p&gt;You can see system variables by giving command like &lt;b&gt;$ set&lt;/b&gt;, some of the important System variables are:&lt;/p&gt;  &lt;table class="MsoNormalTable" style="width: 99%;" width="99%" border="1" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 0.75pt; background: rgb(204, 204, 204) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;System Variable &lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: rgb(204, 204, 204) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Meaning &lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;"&gt;   &lt;td style="padding: 0.75pt; height: 12.75pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;BASH=/bin/bash&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 12.75pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;Our shell name&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;BASH_VERSION=1.14.7(1)&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;Our shell version name&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;COLUMNS=80&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;No. of columns for our screen&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;HOME=/home/vivek&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;Our home directory&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 1.5pt;"&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;LINES=25&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;No. of columns for our   screen&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 1.5pt;"&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;LOGNAME=students&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;students Our logging   name&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 1.5pt;"&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;OSTYPE=Linux&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;Our Os type&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 1.5pt;"&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;PATH=/usr/bin:/sbin:/bin:/usr/sbin&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;Our path settings&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 1.5pt;"&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;PWD=/home/students/Common&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;Our current working   directory&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 1.5pt;"&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;SHELL=/bin/bash&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;Our shell name&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 1.5pt;"&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;USERNAME=vivek&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; height: 1.5pt;" valign="top"&gt;   &lt;p class="MsoNormal" style=""&gt;User name who is   currently login to this PC&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;How to define User defined variables (UDV)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;To define UDV use following syntax&lt;br /&gt;&lt;i&gt;Syntax: &lt;/i&gt;&lt;br /&gt;variable name=value&lt;/p&gt;  &lt;p&gt;'&lt;b&gt;value&lt;/b&gt;' is assigned to given '&lt;b&gt;variable name&lt;/b&gt;' and Value must be on right side = sign.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Example:&lt;br /&gt;&lt;/i&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ no=10&lt;/span&gt;&lt;/code&gt;# this is ok&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ 10=no&lt;/span&gt;&lt;/code&gt;# Error, NOT Ok, Value must be on right side of = sign.&lt;br /&gt;To define variable called 'vech' having value Bus&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ vech=Bus&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;To define variable called n having value 10&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ n=10&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;How to print or access value of UDV (User defined variables)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;To print or access UDV use following syntax&lt;br /&gt;&lt;i&gt;Syntax: &lt;/i&gt;&lt;br /&gt;$variablename&lt;/p&gt;  &lt;p&gt;Define variable vech and n as follows:&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ vech=Bus&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;code&gt;$ n=10&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;To print contains of variable 'vech' type&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ echo $vech&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;It will print 'Bus',To print contains of variable 'n' type command as follows&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ echo $n&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Exercise &lt;/b&gt;&lt;br /&gt;Q.1.How to Define variable x with value 10 and print it on screen.&lt;br /&gt;Q.2.How to Define variable xn with value Rani and print it on screen&lt;br /&gt;Q.3.How to print sum of two numbers, let's say 6 and 3?&lt;br /&gt;Q.4.How to define two variable x=20, y=5 and then to print division of x and y (i.e. x/y)&lt;br /&gt;Q.5.Modify above and store division of x and y to variable called z&lt;br /&gt;Q.6.Point out error if any in following script&lt;/p&gt;  &lt;table class="MsoNormalTable" style="width: 100%;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style="height: 15.75pt;"&gt;   &lt;td style="padding: 0.75pt; background: rgb(204, 204, 204) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; height: 15.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ vi variscript&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;# Script to test MY knowledge about variables!&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;myname=Vivek&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;myos = TroubleOS&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;myno=5&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "My name is $myname"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "My os is $myos"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "My number is myno, can you see this number"&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;echo Command&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;Use echo command to display text or value of variable.&lt;/p&gt;  &lt;p&gt;echo [options] [string, variables...]&lt;br /&gt;Displays text or variables value on screen.&lt;br /&gt;Options&lt;br /&gt;-n Do not output the trailing new line.&lt;br /&gt;-e Enable interpretation of the following backslash escaped characters in the strings:&lt;br /&gt;\a alert (bell)&lt;br /&gt;\b backspace&lt;br /&gt;\c suppress trailing new line&lt;br /&gt;\n new line&lt;br /&gt;\r carriage return&lt;br /&gt;\t horizontal tab&lt;br /&gt;\\ backslash&lt;/p&gt;  &lt;p&gt;For e.g. &lt;b&gt;$ echo -e "An apple a day keeps away \a\t\tdoctor\n"&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;Shell Arithmetic&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;Use to perform arithmetic operations.&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Syntax:&lt;/i&gt;&lt;br /&gt;expr op1 math-operator op2&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Examples: &lt;/i&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ expr 1 + 3&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;code&gt;$ expr 2 - 1&lt;/code&gt;&lt;br /&gt;&lt;code&gt;$ expr 10 / 2&lt;/code&gt;&lt;br /&gt;&lt;code&gt;$ expr 20 % 3&lt;/code&gt;&lt;br /&gt;&lt;code&gt;$ expr 10 \* 3&lt;/code&gt;&lt;br /&gt;&lt;code&gt;$ echo `expr 6 + 3`&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Note:&lt;br /&gt;&lt;/b&gt;expr 20 %3 - Remainder read as 20 mod 3 and remainder is 2.&lt;br /&gt;expr 10 \* 3 - Multiplication use \* and not * since its wild card.&lt;/p&gt;  &lt;p&gt;For the last statement not the following points&lt;/p&gt;  &lt;p&gt;(1) First, before expr keyword we used ` (back quote) sign not the (single quote i.e. ') sign. Back quote is generally found on the key under tilde (~) on PC keyboard OR to the above of TAB key.&lt;/p&gt;  &lt;p&gt;(2) Second, expr is also end with ` i.e. back quote.&lt;/p&gt;  &lt;p&gt;(3) Here expr 6 + 3 is evaluated to 9, then echo command prints 9 as sum&lt;/p&gt;  &lt;p&gt;(4) Here if you use double quote or single quote, it will NOT work&lt;br /&gt;For e.g.&lt;br /&gt;&lt;b&gt;$ echo "expr 6 + 3"&lt;/b&gt; # It will print expr 6 + 3&lt;br /&gt;&lt;b&gt;$ echo 'expr 6 + 3'&lt;/b&gt; # It will print expr 6 + 3&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;There are three types of quotes&lt;/p&gt;  &lt;table class="MsoNormalTable" style="width: 100%;" width="100%" border="1" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 0.75pt; background: rgb(204, 204, 204) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Quotes&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: rgb(204, 204, 204) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: rgb(204, 204, 204) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Meaning&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;"&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;Double Quotes&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;"Double Quotes" - Anything enclose in double   quotes removed meaning of that characters (except \ and $).&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;Single quotes&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;'Single quotes' - Enclosed in single quotes remains   unchanged.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;`&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;Back quote&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;br /&gt;  `Back quote` - To execute command&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;i&gt;Example&lt;/i&gt;:&lt;br /&gt;&lt;b&gt;$ echo "Today is date" &lt;/b&gt;&lt;br /&gt;Can't print message with today's date.&lt;br /&gt;&lt;b&gt;$ echo "Today is `date`". &lt;/b&gt;&lt;br /&gt;It will print today's date as, Today is Tue Jan ....,Can you see that the `date` statement uses back quote?&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 12pt; font-weight: normal;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;Exit Status&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;By default in Linux if particular command/shell script is executed, it return two type of values which is used to see whether command or shell script executed is successful or not.&lt;/p&gt;  &lt;p&gt;(1) If return &lt;i&gt;value is zero&lt;/i&gt; (0), command is successful.&lt;br /&gt;(2) If return &lt;i&gt;value is nonzero&lt;/i&gt;, command is not successful or some sort of error executing command/shell script.&lt;/p&gt;  &lt;p&gt;This value is know as &lt;b&gt;&lt;i&gt;Exit Status&lt;/i&gt;&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;But how to find out exit status of command or shell script?&lt;br /&gt;Simple, to determine this exit Status you can use &lt;b&gt;$? &lt;/b&gt;special variable of shell.&lt;/p&gt;  &lt;p&gt;For e.g. (This example assumes that &lt;b&gt;unknow1file&lt;/b&gt; doest not exist on your hard drive)&lt;br /&gt;&lt;b&gt;$ rm unknow1file &lt;/b&gt;&lt;br /&gt;It will show error as follows&lt;br /&gt;rm: cannot remove `unkowm1file': No such file or directory&lt;br /&gt;and after that if you give command&lt;br /&gt;&lt;b&gt;$ echo $? &lt;/b&gt;&lt;br /&gt;it will print nonzero value to indicate error. Now give command&lt;br /&gt;&lt;b&gt;$ ls&lt;br /&gt;$ echo $? &lt;/b&gt;&lt;br /&gt;It will print 0 to indicate command is successful.&lt;/p&gt;  &lt;p&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;The read Statement&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;Use to get input (data from user) from keyboard and store (data) to variable.&lt;br /&gt;&lt;i&gt;Syntax: &lt;/i&gt;&lt;br /&gt;read variable1, variable2,...variableN&lt;/p&gt;  &lt;p&gt;Following script first ask user, name and then waits to enter name from the user via keyboard. Then user enters name from keyboard (after giving name you have to press ENTER key) and entered name through keyboard is stored (assigned) to variable fname.&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; width: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ vi sayH&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#Script to read your name from key-board&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "Your first name please:"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;read fname&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "Hello $fname, Lets be friend!"&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Run it as follows:&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ chmod 755 sayH&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;code&gt;$ ./sayH&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;i&gt;Your first name please: &lt;b&gt;vivek&lt;/b&gt;&lt;br /&gt;Hello vivek, Lets be friend!&lt;/i&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;Wild cards (Filename Shorthand or meta Characters)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;  &lt;/p&gt;  &lt;table class="MsoNormalTable" style="width: 100%;" width="100%" border="1" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 15%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="15%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Wild card   /Shorthand&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 35%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="35%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Meaning&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td colspan="2" style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="50%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Examples&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="page-break-inside: avoid;"&gt;   &lt;td rowspan="4" style="padding: 0.75pt; width: 15%;" width="15%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;*&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td rowspan="4" style="padding: 0.75pt; width: 35%;" width="35%"&gt;   &lt;p class="MsoNormal"&gt;Matches any string or group of characters.&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 12%;" width="12%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ls *&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 38%;" width="38%"&gt;   &lt;p class="MsoNormal"&gt;will show all files&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="page-break-inside: avoid;"&gt;   &lt;td style="padding: 0.75pt; width: 12%;" width="12%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ls a*&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 38%;" width="38%"&gt;   &lt;p class="MsoNormal"&gt;will show all files whose first name is starting with   letter 'a'&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="page-break-inside: avoid;"&gt;   &lt;td style="padding: 0.75pt; width: 12%;" width="12%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ls *.c&lt;/b&gt;  &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 38%;" width="38%"&gt;   &lt;p class="MsoNormal"&gt;will show all files having extension .c&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="page-break-inside: avoid;"&gt;   &lt;td style="padding: 0.75pt; width: 12%;" width="12%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ls ut*.c&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 38%;" width="38%"&gt;   &lt;p class="MsoNormal"&gt;will show all files having extension .c but file name must   begin with 'ut'.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="page-break-inside: avoid;"&gt;   &lt;td rowspan="2" style="padding: 0.75pt; width: 15%;" width="15%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;?&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td rowspan="2" style="padding: 0.75pt; width: 35%;" width="35%"&gt;   &lt;p class="MsoNormal"&gt;Matches any single character.&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ls ?&lt;/b&gt;  &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;will show all files whose names are 1 character long &lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="page-break-inside: avoid;"&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ls fo?&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;will show all files whose names are 3 character long and   file name begin with fo&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0.75pt; width: 15%;" width="15%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;[...]&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 35%;" width="35%"&gt;   &lt;p class="MsoNormal"&gt;Matches any one of the enclosed characters&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ls [abc]* &lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;will show all files beginning with letters a,b,c&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;b&gt;Note: &lt;/b&gt;&lt;br /&gt;[..-..] A pair of characters separated by a minus sign denotes a range.&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Example&lt;/i&gt;:&lt;br /&gt;&lt;b&gt;$ ls /bin/[a-c]* &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Will show all files name beginning with letter a,b or c like&lt;/p&gt;  &lt;p&gt;   /bin/arch           /bin/awk           /bin/bsh     /bin/chmod           /bin/cp&lt;br /&gt;   /bin/ash           /bin/basename   /bin/cat      /bin/chown           /bin/cpio&lt;br /&gt;   /bin/ash.static   /bin/bash          /bin/chgrp   /bin/consolechars  /bin/csh&lt;/p&gt;  &lt;p&gt;But&lt;br /&gt;&lt;b&gt;$ ls /bin/[!a-o]&lt;br /&gt;$ ls /bin/[^a-o]&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;If the first character following the [ is a ! or a ^ ,then any character not enclosed is matched i.e. do not show us file name that beginning with a,b,c,e...o, like&lt;/p&gt;  &lt;p&gt;   /bin/ps            /bin/rvi              /bin/sleep /bin/touch      /bin/view&lt;br /&gt;   /bin/pwd           /bin/rview        /bin/sort   /bin/true        /bin/wcomp&lt;br /&gt;   /bin/red           /bin/sayHello     /bin/stty   /bin/umount   /bin/xconf&lt;br /&gt;   /bin/remadmin  /bin/sed           /bin/su      /bin/uname     /bin/ypdomainname&lt;br /&gt;   /bin/rm            /bin/setserial    /bin/sync   /bin/userconf  /bin/zcat&lt;br /&gt;   /bin/rmdir         /bin/sfxload      /bin/tar    /bin/usleep&lt;br /&gt;   /bin/rpm           /bin/sh            /bin/tcsh    /bin/vi&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;More command on one command line&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;&lt;i&gt;Syntax:&lt;/i&gt;&lt;br /&gt;command1;command2&lt;br /&gt;To run two command with one command line.&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Examples:&lt;/i&gt;&lt;br /&gt;&lt;b&gt;$ date;who &lt;/b&gt;&lt;br /&gt;Will print today's date followed by users who are currently login. Note that You can't use&lt;br /&gt;&lt;b&gt;$ date who &lt;/b&gt;&lt;br /&gt;for same purpose, you must put semicolon in between date and who command.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;Why Command Line arguments required&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;Telling the command/utility      which option to use. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Informing the utility/command      which file or group of files to process (reading/writing of files). &lt;/li&gt;&lt;/ol&gt;  &lt;p&gt;Let's take rm command, which is used to remove file, but which file you want to remove and how you will tail this to rm command (even rm command don't ask you name of file that you would like to remove). So what we do is we write command as follows:&lt;br /&gt;&lt;b&gt;$ rm {file-name}&lt;/b&gt;&lt;br /&gt;Here rm is command and filename is file which you would like to remove. This way you tail rm command which file you would like to remove. So we are doing one way communication with our command by specifying filename Also you can pass command line arguments to your script to make it more users friendly. But how we access command line argument in our script.&lt;/p&gt;  &lt;p&gt;Lets take ls command&lt;br /&gt;&lt;b&gt;$ Ls -a /* &lt;/b&gt;&lt;br /&gt;This command has 2 command line argument -a and /* is another. For shell script,&lt;br /&gt;&lt;b&gt;$ myshell foo bar &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;  &lt;v:stroke joinstyle="miter"&gt;  &lt;v:formulas&gt;   &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;   &lt;v:f eqn="sum @0 1 0"&gt;   &lt;v:f eqn="sum 0 0 @1"&gt;   &lt;v:f eqn="prod @2 1 2"&gt;   &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;   &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @0 0 1"&gt;   &lt;v:f eqn="prod @6 1 2"&gt;   &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;   &lt;v:f eqn="sum @8 21600 0"&gt;   &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @10 21600 0"&gt;  &lt;/v:formulas&gt;  &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;  &lt;o:lock ext="edit" aspectratio="t"&gt; &lt;/v:shapetype&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75" alt="" style="'width:138pt;"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\06\clip_image001.gif" href="http://www.freeos.com/guides/lsst/images/myshell.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/06/clip_image001.gif" shapes="_x0000_i1025" width="184" height="96" /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1026" type="#_x0000_t75" alt="" style="'width:19.5pt;height:24pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\06\clip_image002.gif" href="http://www.freeos.com/guides/lsst/images/1.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/06/clip_image002.gif" shapes="_x0000_i1026" width="26" height="32" /&gt;&lt;!--[endif]--&gt;Shell Script name i.e. myshell&lt;br /&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1027" type="#_x0000_t75" alt="" style="'width:19.5pt;height:24.75pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\06\clip_image003.gif" href="http://www.freeos.com/guides/lsst/images/2.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/06/clip_image003.gif" shapes="_x0000_i1027" width="26" height="33" /&gt;&lt;!--[endif]--&gt;First command line argument passed to myshell i.e. foo&lt;br /&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1028" type="#_x0000_t75" alt="" style="'width:19.5pt;height:25.5pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\06\clip_image004.gif" href="http://www.freeos.com/guides/lsst/images/3.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/06/clip_image004.gif" shapes="_x0000_i1028" width="26" height="34" /&gt;&lt;!--[endif]--&gt;Second command line argument passed to myshell i.e. bar&lt;/p&gt;  &lt;p&gt;In shell if we wish to refer this command line argument we refer above as follows&lt;/p&gt;  &lt;p&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1029" type="#_x0000_t75" alt="" style="'width:19.5pt;height:24pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\06\clip_image002.gif" href="http://www.freeos.com/guides/lsst/images/1.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/06/clip_image002.gif" shapes="_x0000_i1029" width="26" height="32" /&gt;&lt;!--[endif]--&gt;myshell it is $0&lt;br /&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1030" type="#_x0000_t75" alt="" style="'width:19.5pt;height:24.75pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\06\clip_image003.gif" href="http://www.freeos.com/guides/lsst/images/2.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/06/clip_image003.gif" shapes="_x0000_i1030" width="26" height="33" /&gt;&lt;!--[endif]--&gt;foo it is $1&lt;br /&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1031" type="#_x0000_t75" alt="" style="'width:19.5pt;height:24.75pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\06\clip_image003.gif" href="http://www.freeos.com/guides/lsst/images/2.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/06/clip_image003.gif" shapes="_x0000_i1031" width="26" height="33" /&gt;&lt;!--[endif]--&gt;bar it is $2&lt;/p&gt;  &lt;p&gt;Here &lt;b&gt;$# &lt;/b&gt;(built in shell variable ) will be 2 (Since foo and bar only two Arguments), Please note at a time such 9 arguments can be used from $1..$9, You can also refer all of them by using $* (which expand to `$1,$2...$9`). Note that $1..$9 i.e command line arguments to shell script is know as "&lt;i&gt;positional parameters&lt;/i&gt;".&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Exercise&lt;/b&gt;&lt;br /&gt;Try to write following for commands&lt;br /&gt;Shell Script Name ($0),&lt;br /&gt;No. of Arguments (i.e. $#),&lt;br /&gt;And actual argument (i.e. $1,$2 etc)&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ sum 11 20&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;code&gt;$ math 4 - 7&lt;/code&gt;&lt;br /&gt;&lt;code&gt;$ d&lt;/code&gt;&lt;br /&gt;&lt;code&gt;$ bp -5 myf +20&lt;/code&gt;&lt;br /&gt;&lt;code&gt;$ Ls *&lt;/code&gt;&lt;br /&gt;&lt;code&gt;$ cal&lt;/code&gt;&lt;br /&gt;&lt;code&gt;$ findBS 4 8 24 BIG&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;  &lt;/p&gt;  &lt;table class="MsoNormalTable" style="width: 100%;" width="100%" border="1" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 0.75pt; background: gray none repeat scroll 0% 0%; width: 33%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="33%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Shell Script   Name &lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: gray none repeat scroll 0% 0%; width: 33%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="33%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;No. Of Arguments   to script&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td colspan="5" style="padding: 0.75pt; background: gray none repeat scroll 0% 0%; width: 34%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="34%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Actual Argument   ($1,..$9)&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 33%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="33%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;i&gt;$0&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 33%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="33%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;i&gt;$#&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 7%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="7%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;i&gt;$1&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 7%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="7%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;i&gt;$2&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 7%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="7%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;i&gt;$3&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 7%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="7%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;i&gt;$4&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 6%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="6%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;&lt;i&gt;$5&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;Sum&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;2&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;11&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;20&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 6%;" width="6%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;Math&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;3&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;4&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;-&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;7&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 6%;" width="6%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;D&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;0&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 6%;" width="6%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;Bp&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;3&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;-5&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;myf&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;+20&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 6%;" width="6%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;Ls&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;1&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;*&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 6%;" width="6%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;&lt;st1:state st="on"&gt;&lt;st1:place st="on"&gt;Cal&lt;/st1:place&gt;&lt;/st1:state&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;0&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 6%;" width="6%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;FindBS&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 33%;" width="33%"&gt;   &lt;p class="MsoNormal"&gt;4&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;4&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;8&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;24&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 7%;" width="7%"&gt;   &lt;p class="MsoNormal"&gt;BIG&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 6%;" width="6%"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Following script is used to print command ling argument and will show you how to access them:&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; width: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ vi demo&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;#!/bin/sh&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;# Script that demos, command line args&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "Total number of command line argument are $#"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "$0 is script name"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "$1 is first argument"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "$2 is second argument"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "All of them are :- $* or $@"&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Run it as follows&lt;/p&gt;  &lt;p&gt;Set execute permission as follows:&lt;br /&gt;&lt;b&gt;$ chmod 755 demo&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Run it &amp;amp; test it as follows:&lt;br /&gt;&lt;b&gt;$ ./demo Hello World&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;If test successful, copy script to your own bin directory (Install script for private use)&lt;br /&gt;&lt;b&gt;$ cp demo ~/bin&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Check whether it is working or not (?)&lt;br /&gt;&lt;b&gt;$ demo&lt;/b&gt;&lt;br /&gt;&lt;b&gt;$ demo Hello World&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Also note that you &lt;b&gt;&lt;i&gt;can't assigne the new value to command line arguments i.e positional parameters&lt;/i&gt;&lt;/b&gt;. So following all statements in shell script are invalid:&lt;br /&gt;&lt;b&gt;$1 = 5&lt;br /&gt;$2 = "My Name"&lt;/b&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;Redirection of Standard output/input i.e. Input - Output redirection&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;Mostly all command gives output on screen or take input from keyboard, but in Linux (and in other OSs also) it's possible to send output to file or to read input from file.&lt;/p&gt;  &lt;p&gt;For e.g.&lt;br /&gt;&lt;b&gt;$ ls&lt;/b&gt; command gives output to screen; to send output to file of ls command give command&lt;br /&gt;&lt;br /&gt;&lt;b&gt;$ ls &gt; filename&lt;/b&gt;&lt;br /&gt;It means put output of ls command to filename.&lt;/p&gt;  &lt;p&gt;There are three main redirection symbols &lt;b&gt;&gt;,&gt;&gt;,&lt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;(1) &gt; Redirector Symbol&lt;br /&gt;&lt;i&gt;Syntax:&lt;/i&gt;&lt;br /&gt;Linux-command &gt; filename&lt;br /&gt;To output Linux-commands result (output of command or shell script) to file. Note that if file already exist, it will be overwritten else new file is created. For e.g. To send output of ls command give&lt;br /&gt;&lt;b&gt;$ ls &gt; myfiles&lt;/b&gt;&lt;br /&gt;Now if '&lt;b&gt;myfiles&lt;/b&gt;' file exist in your current directory it will be overwritten without any type of warning.&lt;/p&gt;  &lt;p&gt;(2) &gt;&gt; Redirector Symbol&lt;br /&gt;&lt;i&gt;Syntax:&lt;/i&gt;&lt;br /&gt;Linux-command &gt;&gt; filename&lt;br /&gt;To output Linux-commands result (output of command or shell script) to END of file. Note that if file exist , it will be opened and new information/data will be written to END of file, without losing previous information/data, And if file is not exist, then new file is created. For e.g. To send output of date command to already exist file give command&lt;br /&gt;&lt;b&gt;$ date &gt;&gt; myfiles&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;(3) &lt; Redirector Symbol&lt;br /&gt;&lt;i&gt;Syntax:&lt;/i&gt;&lt;br /&gt;Linux-command &lt; filename&lt;br /&gt;To take input to Linux-command from file instead of key-board. For e.g. To take input for cat command give&lt;br /&gt;&lt;b&gt;$ cat &lt;&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;Pipes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;A pipe is a way to connect the output of one program to the input of another program without any temporary file.&lt;/p&gt;  &lt;p style="text-align: center;" align="center"&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1032" type="#_x0000_t75" alt="Pipe - Redirecting output of 1st command to 2nd without creating temporary file" style="'width:216.75pt;height:87pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\06\clip_image005.gif" href="http://www.freeos.com/guides/lsst/images/pipe.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/06/clip_image005.gif" alt="Pipe - Redirecting output of 1st command to 2nd without creating temporary file" shapes="_x0000_i1032" width="289" height="116" /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p&gt;Pipe Defined as:&lt;br /&gt;"&lt;i&gt;A pipe is nothing but a temporary storage place where the output of one command is stored and then passed as the input for second command. Pipes are used to run more than two commands ( Multiple commands) from same command line.&lt;/i&gt;"&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Syntax:&lt;/i&gt;&lt;br /&gt;command1 | command2&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Examles:&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;  &lt;/p&gt;  &lt;table class="MsoNormalTable" style="width: 100%;" width="100%" border="1" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="50%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Command using   Pipes&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="50%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Meaning or Use   of Pipes&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 20.25pt;"&gt;   &lt;td style="padding: 0.75pt; width: 50%; height: 20.25pt;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ls | more&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%; height: 20.25pt;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Output of ls command is given as input to more command So   that output is printed one screen full page at a time.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ who | sort &lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Output of who command is given as input to sort command So   that it will print sorted list of users&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ who | sort &gt; user_list&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Same as above except output of sort is send to   (redirected) user_list file&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ who | wc -l &lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Output of who command is given as input to wc command So   that it will number of user who logon to system&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ls -l | wc  -l   &lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Output of ls command is given as input to wc command So   that it will print number of files in current directory.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 1.5pt;"&gt;   &lt;td style="padding: 0.75pt; width: 50%; height: 1.5pt;" width="50%"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;b&gt;$ who | grep raju&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%; height: 1.5pt;" width="50%"&gt;   &lt;p class="MsoNormal" style=""&gt;Output of who command is   given as input to grep command So that it will print if particular user name   if he is logon or nothing is printed (To see particular user is logon or not)&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;Filter&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;If a Linux command accepts its input from the standard input and produces its output on standard output is know as a filter. A filter performs some kind of process on the input and gives output. For e.g.. Suppose you have file called 'hotel.txt' with 100 lines data, And from 'hotel.txt' you would like to print contains from line number 20 to line number 30 and store this result to file called 'hlist' then give command:&lt;br /&gt;&lt;b&gt;$ tail +20 &lt;&gt;hlist&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Here &lt;b&gt;head&lt;/b&gt; command is filter which takes its input from tail command (tail command start selecting from line number 20 of given file i.e. hotel.txt) and passes this lines as input to head, whose output is redirected to 'hlist' file.&lt;/p&gt;  &lt;p&gt;Consider one more following example&lt;br /&gt;&lt;b&gt;$ sort &lt;&gt; u_sname&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Here &lt;a href="http://www.freeos.com/guides/lsst/ch05sec08.html"&gt;&lt;span style=""&gt;uniq&lt;/span&gt;&lt;/a&gt; is filter which takes its input from sort command and passes this lines as input to uniq; Then uniqs output is redirected to "u_sname" file.&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;Command Related with Process&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;Following tables most commonly used command(s) with process:&lt;/p&gt;  &lt;table class="MsoNormalTable" style="width: 100%;" width="100%" border="1" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 32%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="32%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;For this purpose&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 30%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="30%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Use this Command&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 25%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="25%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Examples*&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 32%;" width="32%"&gt;   &lt;p class="MsoNormal"&gt;To see currently running process &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 30%;" width="30%"&gt;   &lt;p class="MsoNormal"&gt;ps&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ps&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 32%;" width="32%"&gt;   &lt;p class="MsoNormal"&gt;To stop any process by PID i.e. to kill process&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 30%;" width="30%"&gt;   &lt;p class="MsoNormal"&gt;kill    {PID}&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ kill  1012&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 32%;" width="32%"&gt;   &lt;p class="MsoNormal"&gt;To stop processes by name i.e. to kill process&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 30%;" width="30%"&gt;   &lt;p class="MsoNormal"&gt;killall   {Process-name}&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ killall httpd&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 32%;" width="32%"&gt;   &lt;p class="MsoNormal"&gt;To get information about all running process&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 30%;" width="30%"&gt;   &lt;p class="MsoNormal"&gt;ps -ag&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ps -ag&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 32%;" width="32%"&gt;   &lt;p class="MsoNormal"&gt;To stop all process except your shell&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 30%;" width="30%"&gt;   &lt;p class="MsoNormal"&gt;kill 0&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ kill 0&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 32%;" width="32%"&gt;   &lt;p class="MsoNormal"&gt;For background processing (With &amp;amp;, use to put   particular command and program in background)&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 30%;" width="30%"&gt;   &lt;p class="MsoNormal"&gt;linux-command  &amp;amp;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ls / -R | wc -l &amp;amp;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 32%;" width="32%"&gt;   &lt;p class="MsoNormal"&gt;To display the owner of the processes along with the   processes &lt;tt&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/tt&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 30%;" width="30%"&gt;   &lt;p class="MsoNormal"&gt;ps aux&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ ps aux&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 32%;" width="32%"&gt;   &lt;p class="MsoNormal"&gt;To see if a particular process is running or not. For this   purpose you have to use ps command in combination with the grep command&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 30%;" width="30%"&gt;   &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;ps ax | grep  process-U-want-to see&lt;/p&gt;   &lt;p&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;For e.g. you want to see whether Apache web server process   is running or not then give command &lt;/p&gt;   &lt;p&gt;&lt;b&gt;$ ps ax | grep httpd&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 32%;" width="32%"&gt;   &lt;p class="MsoNormal"&gt;To see currently running processes and other information   like memory and CPU usage with real time updates.&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 30%;" width="30%"&gt;   &lt;p class="MsoNormal"&gt;top&lt;br /&gt;  &lt;span style="font-size: 10pt;"&gt;&lt;a href="http://www.freeos.com/guides/lsst/images/toppid.jpg" target="_blank"&gt;See   the output&lt;/a&gt; of top command.&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;br /&gt;  $ top&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 10pt;"&gt;&lt;br /&gt; &lt;br /&gt;  Note &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt;"&gt;that to exit from top command   press q.&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0.75pt; width: 32%;" width="32%"&gt;   &lt;p class="MsoNormal"&gt;To display a tree of processes&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 30%;" width="30%"&gt;   &lt;p class="MsoNormal"&gt;pstree&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 25%;" width="25%"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;$ pstree&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;b&gt;*&lt;/b&gt; To run some of this command you need to be root or equivalnt user.&lt;/p&gt;  &lt;h1&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/h1&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;if condition&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;if condition which is used for decision making in shell script, If given condition is true then command1 is executed.&lt;br /&gt;&lt;i&gt;Syntax:&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/p&gt;  &lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;        &lt;/span&gt;if condition&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;        &lt;/span&gt;then&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;               &lt;/span&gt;command1 if condition is true or if exit status&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;               &lt;/span&gt;of condition is 0 (zero)&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;               &lt;/span&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;               &lt;/span&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;        &lt;/span&gt;fi&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;  &lt;p&gt;Condition is defined as:&lt;br /&gt;"&lt;i&gt;Condition is nothing but comparison between two values.&lt;/i&gt;"&lt;br /&gt;&lt;br /&gt;For compression you can use test or [ expr ] statements or even exist status can be also used.&lt;br /&gt;&lt;br /&gt;Expreession is defined as:&lt;br /&gt;"&lt;i&gt;An expression is nothing but combination of values, relational operator (such as &gt;,&lt;, &lt;&gt; etc) and mathematical operators (such as +, -, / etc ).&lt;/i&gt;"&lt;br /&gt;&lt;br /&gt;Following are all examples of expression:&lt;br /&gt;5 &gt; 2&lt;br /&gt;3 + 6&lt;br /&gt;3 * 65&lt;br /&gt;a &lt; b&lt;br /&gt;c &gt; 5&lt;br /&gt;c &gt; 5 + 30 -1&lt;/p&gt;  &lt;p&gt;Type following commands (assumes you have file called &lt;b&gt;foo&lt;/b&gt;)&lt;br /&gt;&lt;b&gt;$ cat foo&lt;br /&gt;$ echo $? &lt;/b&gt;&lt;br /&gt;The cat command return zero(0) i.e. exit status, on successful, this can be used, in if condition as follows, Write shell script as&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; width: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style="height: 56.25pt;"&gt;   &lt;td style="padding: 0.75pt; height: 56.25pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ cat &gt; showfile&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;#!/bin/sh&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#Script to print file&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;if cat $1&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;then&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo -e "\n\nFile $1, found and successfully echoed"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;fi&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Run above script as:&lt;br /&gt;&lt;b&gt;$ chmod 755 showfile&lt;/b&gt;&lt;br /&gt;&lt;b&gt;$./showfile foo&lt;/b&gt;&lt;br /&gt;Shell script name is showfile ($0) and foo is argument (which is $1).Then shell compare it as follows:&lt;br /&gt;if cat $1 which is expanded to if cat foo.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;Detailed explanation&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;if cat command finds foo file and if its successfully shown on screen, it means our cat command is successful and its exist status is 0 (indicates success), So our if condition is also true and hence statement echo -e "\n\nFile $1, found and successfully echoed" is proceed by shell. Now if cat command is not successful then it returns non-zero value (indicates some sort of failure) and this statement echo -e "\n\nFile $1, found and successfully echoed" is skipped by our shell.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Exercise&lt;/b&gt;&lt;br /&gt;Write shell script as follows:&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; width: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;cat &gt; trmif&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;# Script to test rm command and exist status&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;if rm $1&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;then&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "$1 file deleted"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;fi&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Press Ctrl + d to save&lt;br /&gt;&lt;b&gt;$ chmod 755 trmif&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Answer the following question in referance to above script:&lt;br /&gt;(A) foo file exists on your disk and you give command, &lt;b&gt;$ ./trmfi foo&lt;/b&gt; what will be output?&lt;br /&gt;(B) If bar file not present on your disk and you give command, &lt;b&gt;$ ./trmfi bar &lt;/b&gt;what will be output?&lt;br /&gt;(C) And if you type &lt;b&gt;$ ./trmfi&lt;/b&gt; What will be output?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;test command or [ expr ]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;test command or [ expr ] is used to see if an expression is true, and if it is true it return zero(0), otherwise returns nonzero for false.&lt;br /&gt;&lt;i&gt;Syntax: &lt;/i&gt;&lt;br /&gt;test expression OR [ expression ]&lt;br /&gt;&lt;i&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;/i&gt;Following script determine whether given argument number is positive.&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; width: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ cat &gt; ispostive&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;#!/bin/sh&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;# Script to see whether argument is positive&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;if test $1 -gt 0&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;then&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "$1 number is positive"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;fi&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Run it as follows&lt;br /&gt;&lt;b&gt;$ chmod 755 ispostive&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;$ ispostive 5&lt;/b&gt;&lt;br /&gt;&lt;i&gt;5 number is positive&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;$ispostive -45&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Nothing is printed&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;$ispostive&lt;/b&gt;&lt;br /&gt;&lt;i&gt;./ispostive: test: -gt: unary operator expected &lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;Detailed explanation&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;The line, if test $1 -gt 0 , test to see if first command line argument($1) is greater than 0. If it is true(0) then test will return 0 and output will printed as 5 number is positive but for -45 argument there is no output because our condition is not true(0) (no -45 is not greater than 0) hence echo statement is skipped. And for last statement we have not supplied any argument hence error ./ispostive: test: -gt: unary operator expected, is generated by shell , to avoid such error we can test whether command line argument is supplied or not.&lt;/p&gt;  &lt;p&gt;test or [ expr ] works with&lt;br /&gt;1.Integer ( Number without decimal point)&lt;br /&gt;2.File types&lt;br /&gt;3.Character strings&lt;/p&gt;  &lt;p style="text-align: center;" align="center"&gt;&lt;b&gt;For Mathematics, use following operator in Shell Script&lt;/b&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="width: 100%;" width="100%" border="1" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 0.75pt; background: gray none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Mathematical   Operator in  Shell Script &lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: gray none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Meaning&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: gray none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Normal   Arithmetical/ Mathematical Statements&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td colspan="2" style="padding: 0.75pt; background: gray none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;But in Shell&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt; &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;For test   statement with if command&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;For [ expr ]   statement with if command&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;-eq&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;is equal to&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;5 == 6&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;if test 5 -eq 6&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;if [ 5 -eq 6 ]&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;-ne&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;is not equal to&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;5 != 6&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;if test 5 -ne 6&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;if [ 5 -ne 6 ]&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;-lt&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;is less than&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;5 &lt;&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;if test 5 -lt 6&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;if [ 5 -lt 6 ]&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;-le&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;is less than or equal to&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;5 &lt;= 6&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;if test 5 -le 6&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;if [ 5 -le 6 ]&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;-gt&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;is greater than&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;5 &gt; 6&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;if test 5 -gt 6&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;if [ 5 -gt 6 ]&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;-ge&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;is greater than or equal to&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;5 &gt;= 6&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;if test 5 -ge 6&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;if [ 5 -ge 6 ]&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;b&gt;NOTE:&lt;/b&gt; == is equal, != is not equal.&lt;/p&gt;  &lt;p style="text-align: center;" align="center"&gt;&lt;b&gt;For string Comparisons use&lt;/b&gt;&lt;/p&gt;  &lt;div align="center"&gt;  &lt;table class="MsoNormalTable" style="width: 73%;" width="73%" border="1" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 24%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="24%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Operator&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 76%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="76%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Meaning&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 24%;" width="24%"&gt;   &lt;p class="MsoNormal"&gt;string1 = string2&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 76%;" width="76%"&gt;   &lt;p class="MsoNormal"&gt;string1 is equal to string2&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 24%;" width="24%"&gt;   &lt;p class="MsoNormal"&gt;string1 != string2&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 76%;" width="76%"&gt;   &lt;p class="MsoNormal"&gt;string1 is NOT equal to string2&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 24%;" width="24%"&gt;   &lt;p class="MsoNormal"&gt;string1&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 76%;" width="76%"&gt;   &lt;p class="MsoNormal"&gt;string1 is NOT NULL or not defined &lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 24%;" width="24%"&gt;   &lt;p class="MsoNormal"&gt;-n string1&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 76%;" width="76%"&gt;   &lt;p class="MsoNormal"&gt;string1 is NOT NULL and does exist&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0.75pt; width: 24%;" width="24%"&gt;   &lt;p class="MsoNormal"&gt;-z string1&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 76%;" width="76%"&gt;   &lt;p class="MsoNormal"&gt;string1 is NULL and does exist&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;/div&gt;  &lt;p style="text-align: center;" align="center"&gt;&lt;b&gt;Shell also test for file and directory types&lt;/b&gt;&lt;/p&gt;  &lt;div align="center"&gt;  &lt;table class="MsoNormalTable" style="width: 63%;" width="63%" border="1" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 19%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="19%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Test&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 81%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="81%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Meaning&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 19%;" width="19%"&gt;   &lt;p class="MsoNormal"&gt;-s file   &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 81%;" width="81%"&gt;   &lt;p class="MsoNormal"&gt;Non empty file&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 19%;" width="19%"&gt;   &lt;p class="MsoNormal"&gt;-f file   &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 81%;" width="81%"&gt;   &lt;p class="MsoNormal"&gt;Is File exist or normal file and not a directory &lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 19%;" width="19%"&gt;   &lt;p class="MsoNormal"&gt;-d dir    &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 81%;" width="81%"&gt;   &lt;p class="MsoNormal"&gt;Is Directory exist and not a file&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 19%;" width="19%"&gt;   &lt;p class="MsoNormal"&gt;-w file  &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 81%;" width="81%"&gt;   &lt;p class="MsoNormal"&gt;Is writeable file&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 19%;" width="19%"&gt;   &lt;p class="MsoNormal"&gt;-r file   &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 81%;" width="81%"&gt;   &lt;p class="MsoNormal"&gt;Is read-only file&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0.75pt; width: 19%;" width="19%"&gt;   &lt;p class="MsoNormal"&gt;-x file   &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 81%;" width="81%"&gt;   &lt;p class="MsoNormal"&gt;Is file is executable&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;/div&gt;  &lt;p style="text-align: center;" align="center"&gt;&lt;b&gt;Logical Operators&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Logical operators are used to combine two or more condition at a time&lt;/p&gt;  &lt;div align="center"&gt;  &lt;table class="MsoNormalTable" style="width: 72%;" width="72%" border="1" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="50%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Operator           &lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; background: silver none repeat scroll 0% 0%; width: 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="50%"&gt;   &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;b&gt;Meaning &lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;! expression&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Logical NOT&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;expression1  -a  expression2&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Logical AND&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;expression1  -o  expression2&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Logical OR&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;if...else...fi&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;If given condition is true then command1 is executed otherwise command2 is executed.&lt;br /&gt;&lt;i&gt;Syntax:&lt;/i&gt;&lt;/p&gt;  &lt;pre&gt;&lt;span style=""&gt;           &lt;/span&gt;if condition&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;           &lt;/span&gt;then&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;condition is zero (true - 0)&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;execute all commands up to else statement&lt;/pre&gt;&lt;pre&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;           &lt;/span&gt;else&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;if condition is not true then&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;execute all commands up to fi&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;           &lt;/span&gt;fi&lt;/pre&gt;  &lt;p&gt;For e.g. Write Script as follows:&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; width: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style="height: 198.75pt;"&gt;   &lt;td style="padding: 0.75pt; height: 198.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ vi isnump_n&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;#!/bin/sh&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;# Script to see whether argument is positive or negative&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;if [ $# -eq 0 ]&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;then&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "$0 : You must give/supply one integers"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;exit 1&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;fi&lt;/code&gt;&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-size: 10pt;"&gt;if test $1 -gt 0&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;then&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "$1 number is positive"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;else&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "$1 number is negative"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;fi&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Try it as follows:&lt;br /&gt;&lt;b&gt;$ chmod 755 isnump_n&lt;br /&gt;&lt;br /&gt;$ isnump_n 5&lt;/b&gt;&lt;br /&gt;&lt;i&gt;5 number is positive&lt;/i&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;$ isnump_n -45 &lt;/b&gt;&lt;br /&gt;&lt;i&gt;-45 number is negative&lt;/i&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;$ isnump_n&lt;/b&gt;&lt;br /&gt;&lt;i&gt;./ispos_n : You must give/supply one integers&lt;/i&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;$ isnump_n 0&lt;/b&gt;&lt;br /&gt;&lt;i&gt;0 number is negative&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;Detailed explanation&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;First script checks whether command line argument is given or not, if not given then it print error message as "&lt;i&gt;./ispos_n : You must give/supply one integers&lt;/i&gt;". if statement checks whether number of argument ($#) passed to script is not equal (-eq) to 0, if we passed any argument to script then this if statement is false and if no command line argument is given then this if statement is true. The echo command i.e.&lt;br /&gt;echo "$0 : You must give/supply one integers"&lt;br /&gt;         |              |&lt;br /&gt;         |              |&lt;br /&gt;        1             2&lt;br /&gt;1 will print Name of script&lt;br /&gt;2 will print this error message&lt;br /&gt;And finally statement exit 1 causes normal program termination with exit status 1 (nonzero means script is not successfully run).&lt;/p&gt;  &lt;p&gt;The last sample run&lt;b&gt; $ isnump_n 0&lt;/b&gt; , gives output as "&lt;i&gt;0 number is negative&lt;/i&gt;", because given argument is not &gt; 0, hence condition is false and it's taken as negative number. To avoid this replace second if statement with &lt;b&gt;if test $1 -ge 0&lt;/b&gt;.&lt;/p&gt;  &lt;h1&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1033" type="#_x0000_t75" alt="" style="'width:6.75pt;height:9.75pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\06\clip_image006.gif" href="http://www.freeos.com/guides/lsst/images/bulb.gif"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/06/clip_image006.gif" shapes="_x0000_i1033" width="9" border="0" height="13" /&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 16pt;"&gt;Nested if-else-fi&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;You can write the entire if-else construct within either the body of the if statement of the body of an else statement. This is called the nesting of ifs.&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; width: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ vi nestedif.sh&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;osch=0&lt;/code&gt;&lt;br /&gt; &lt;br /&gt;  &lt;code&gt;echo "1. Unix (Sun Os)"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "2. Linux (Red Hat)"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo -n "Select your os choice [1 or 2]? "&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;read osch&lt;/code&gt;&lt;br /&gt; &lt;br /&gt;  &lt;code&gt;if [ $osch -eq 1 ] ; then&lt;/code&gt;&lt;br /&gt; &lt;br /&gt;  &lt;code&gt;     echo "You Pick up Unix (Sun Os)"&lt;/code&gt;&lt;br /&gt; &lt;br /&gt;  &lt;code&gt;else #### nested if i.e. if within if ######&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;            &lt;/code&gt;&lt;br /&gt;  &lt;code&gt;       if [ $osch -eq 2 ] ; then&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;             echo   "You Pick up Linux (Red Hat)"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;       else&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;             echo   "What you don't like Unix/Linux OS."&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;       fi&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;fi&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Run the above shell script as follows:&lt;br /&gt;&lt;b&gt;$ chmod +x nestedif.sh&lt;br /&gt;$ ./nestedif.sh&lt;/b&gt;&lt;br /&gt;&lt;i&gt;1. Unix (Sun Os)&lt;br /&gt;2. Linux (Red Hat)&lt;br /&gt;Select you os choice [1 or 2]? &lt;b&gt;1&lt;/b&gt;&lt;br /&gt;You Pick up Unix (Sun Os)&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;$ ./nestedif.sh&lt;/b&gt;&lt;br /&gt;&lt;i&gt;1. Unix (Sun Os)&lt;br /&gt;2. Linux (Red Hat)&lt;br /&gt;Select you os choice [1 or 2]? &lt;b&gt;2&lt;/b&gt;&lt;br /&gt;You Pick up Linux (Red Hat)&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;$ ./nestedif.sh&lt;/b&gt;&lt;br /&gt;&lt;i&gt;1. Unix (Sun Os)&lt;br /&gt;2. Linux (Red Hat)&lt;br /&gt;Select you os choice [1 or 2]? &lt;b&gt;3&lt;/b&gt;&lt;br /&gt;What you don't like Unix/Linux OS.&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;Note that Second &lt;i&gt;if-else&lt;/i&gt; constuct is nested in the first &lt;i&gt;else&lt;/i&gt; statement. If the condition in the first &lt;i&gt;if&lt;/i&gt; statement is false the the condition in the second &lt;i&gt;if&lt;/i&gt; statement is checked. If it is false as well the final &lt;i&gt;else&lt;/i&gt; statement is executed.&lt;/p&gt;  &lt;p&gt;You can use the nested &lt;i&gt;if&lt;/i&gt;s as follows also:&lt;br /&gt;&lt;i&gt;Syntax:&lt;/i&gt;&lt;/p&gt;  &lt;pre&gt;&lt;span style=""&gt;        &lt;/span&gt;if condition&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;        &lt;/span&gt;then&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;               &lt;/span&gt;if condition&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;               &lt;/span&gt;then&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;.....&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;..&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;do this&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;               &lt;/span&gt;else&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;....&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;..&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;do this&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;               &lt;/span&gt;fi&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;        &lt;/span&gt;else&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;               &lt;/span&gt;...&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;               &lt;/span&gt;.....&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;               &lt;/span&gt;do this&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;        &lt;/span&gt;fi&lt;/pre&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;Multilevel if-then-else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p class="MsoNormal"&gt;&lt;i&gt;Syntax:&lt;/i&gt;&lt;/p&gt;  &lt;pre&gt;&lt;span style=""&gt;           &lt;/span&gt;if condition&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;           &lt;/span&gt;then&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;condition is zero (true - 0)&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;execute all commands up to elif statement&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;           &lt;/span&gt;elif condition1&lt;br /&gt;&lt;span style=""&gt;           &lt;/span&gt;then&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;condition1 is zero (true - 0)&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;execute all commands up to elif statement&lt;span style=""&gt;  &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;           &lt;/span&gt;elif condition2&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;           &lt;/span&gt;then&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;condition2 is zero (true - 0)&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;execute all commands up to elif statement&lt;span style=""&gt;          &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;           &lt;/span&gt;else&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;None of the above condtion,condtion1,condtion2 are true (i.e. &lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;all of the above nonzero or false)&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;                       &lt;/span&gt;execute all commands up to fi&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;           &lt;/span&gt;fi&lt;/pre&gt;  &lt;p&gt;For multilevel if-then-else statement try the following script:&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; width: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style="height: 120.75pt;"&gt;   &lt;td style="padding: 0.75pt; height: 120.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ cat &gt; elf&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#!/bin/sh&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;# Script to test if..elif...else&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;if [ $1 -gt 0 ]; then&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;  echo "$1 is positive"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;elif [ $1 -lt 0 ]&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;then&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;  echo "$1 is negative"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;elif [ $1 -eq 0 ]&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;then&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;  echo "$1 is zero"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;else&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;  echo "Opps! $1 is not number, give number"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;fi&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;Loops in Shell Scripts&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;&lt;st1:place st="on"&gt;Loop&lt;/st1:place&gt; defined as:&lt;br /&gt;"&lt;i&gt;Computer can repeat particular instruction again and again, until particular condition satisfies. A group of instruction that is executed repeatedly is called a loop.&lt;/i&gt;"&lt;/p&gt;  &lt;p&gt;Bash supports:&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;for loop &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;while loop&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;&lt;b&gt;Note &lt;/b&gt;that in each and every loop,&lt;/p&gt;  &lt;p&gt;(a) First, the variable used in loop condition must be initialized, then execution of the loop begins.&lt;/p&gt;  &lt;p&gt;(b) A test (condition) is made at the beginning of each iteration.&lt;/p&gt;  &lt;p&gt;(c) The body of loop ends with a statement that modifies the value of the test (condition) variable.&lt;/p&gt;  &lt;h1&gt;for &lt;st1:place st="on"&gt;Loop&lt;/st1:place&gt;&lt;/h1&gt;  &lt;p class="MsoNormal"&gt;&lt;i&gt;Syntax:&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/p&gt;  &lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;            &lt;/span&gt;for { variable name } in { list }&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;            &lt;/span&gt;do&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                     &lt;/span&gt;execute one for each item in the list until the list is&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                     &lt;/span&gt;not finished (And repeat all statement between do and done)&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;          &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;done&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;  &lt;p&gt;Before try to understand above syntax try the following script:&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; width: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style="height: 51.75pt;"&gt;   &lt;td style="padding: 0.75pt; height: 51.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ cat &gt; testfor&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;for i in 1 2 3 4 5&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;do&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;echo "Welcome $i times"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;done&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;while loop&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;&lt;i&gt;Syntax:&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/p&gt;  &lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;           &lt;/span&gt;while [ condition ]&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;           &lt;/span&gt;do&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                 &lt;/span&gt;command1&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                 &lt;/span&gt;command2&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                 &lt;/span&gt;command3&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                 &lt;/span&gt;..&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                 &lt;/span&gt;....&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;            &lt;/span&gt;done&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;  &lt;p&gt;&lt;st1:place st="on"&gt;Loop&lt;/st1:place&gt; is executed as long as given condition is true. For e.g.. &lt;a href="http://www.freeos.com/guides/lsst/ch03sec06.html#forloopprog"&gt;Above for loop program&lt;/a&gt; (shown in last section of for loop) can be written using while loop as:&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; width: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$cat &gt; nt1&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;#!/bin/sh&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#Script to test while statement&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;if [ $# -eq 0 ]&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;then&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;   echo "Error - Number missing form command line   argument"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;   echo "Syntax : $0 number"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;   echo " Use to print multiplication table for   given number"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;exit 1&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;fi&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;n=$1&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;i=1&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;while [ $i -le 10 ]&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;do&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;  echo "$n * $i = `expr $i \* $n`"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;  i=`expr $i + 1`&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;done&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Save it and try as&lt;br /&gt;&lt;b&gt;$ chmod 755 nt1&lt;br /&gt;$./nt1 7&lt;br /&gt;&lt;/b&gt;Above loop can be explained as follows:&lt;/p&gt;  &lt;p&gt;  &lt;/p&gt;  &lt;table class="MsoNormalTable" style="width: 100%;" width="100%" border="1" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;n=$1&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Set the value of command line argument to variable n.   (Here it's set to 7 )&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;i=1&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Set variable i to 1&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;while [ $i -le 10   ]                  &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;This is our loop condition, here if value of i is less   than 10 then, shell execute all statements between do and done&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;do &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Start loop&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;echo "$n  *  $i = `expr $i  \*    $n`"&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Print multiplication table as&lt;br /&gt;  7 * 1 = 7&lt;br /&gt;  7 * 2 = 14&lt;br /&gt;  ....&lt;br /&gt;  7 * 10 = 70, Here each time value of variable n is multiply be i.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;i=`expr $i + 1`&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;Increment i by 1 and store result to i.  ( i.e.   i=i+1)&lt;br /&gt;  &lt;b&gt;&lt;u&gt;&lt;span style="color: red;"&gt;Caution:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt; If you ignore (remove)   this statement  than our loop become infinite loop because value of   variable i always remain less than 10 and program will only output&lt;br /&gt;  7 * 1 = 7&lt;br /&gt;  ...&lt;br /&gt;  ...&lt;br /&gt;  E (infinite times)&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p class="MsoNormal"&gt;done                                   &lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0.75pt; width: 50%;" width="50%"&gt;   &lt;p&gt;&lt;st1:place st="on"&gt;Loop&lt;/st1:place&gt; stops here if i is not less than 10   i.e. condition of loop is not true. Hence&lt;br /&gt;  loop is terminated.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;The case Statement&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p class="MsoNormal"&gt;The case statement is good alternative to Multilevel if-then-else-fi statement. It enable you to match several values against one variable. Its easier to read and write.&lt;br /&gt;&lt;i&gt;Syntax:&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/p&gt;  &lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;           &lt;/span&gt;case&lt;span style=""&gt;  &lt;/span&gt;$variable-name&lt;span style=""&gt;  &lt;/span&gt;in&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                &lt;/span&gt;pattern1)&lt;span style=""&gt;   &lt;/span&gt;command&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                                &lt;/span&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                                &lt;/span&gt;..&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                                &lt;/span&gt;command;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                &lt;/span&gt;pattern2)&lt;span style=""&gt;   &lt;/span&gt;command&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style=""&gt;        &lt;/span&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                                &lt;/span&gt;..&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                                &lt;/span&gt;command;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                &lt;/span&gt;patternN)&lt;span style=""&gt;   &lt;/span&gt;command&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                                &lt;/span&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                                &lt;/span&gt;..&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                                &lt;/span&gt;command;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                &lt;/span&gt;*)&lt;span style=""&gt;             &lt;/span&gt;command&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                                &lt;/span&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                                &lt;/span&gt;..&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;                                &lt;/span&gt;command;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;span style=""&gt;           &lt;/span&gt;esac&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/pre&gt;  &lt;p&gt;The&lt;i&gt; $variable-name&lt;/i&gt; is compared against the patterns until a match is found. The shell then executes all the statements up to the two semicolons that are next to each other. The default is *) and its executed if no match is found. For e.g. write script as follows:&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; width: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;$ cat &gt; car&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;# if no vehicle name is given&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;# i.e. -z $1 is defined and it is NULL&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;#&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;# if no command line arg&lt;/code&gt;&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;if [ -z $1 ]&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;then&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;  rental="*** Unknown vehicle ***"&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;elif [ -n $1 ]&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;then&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;# otherwise make first arg as rental&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;  rental=$1&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;fi&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;code&gt;&lt;span style="font-size: 10pt;"&gt;case $rental in&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;  &lt;code&gt;   "car") echo "For $rental Rs.20 per   k/m";;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;   "van") echo "For $rental Rs.10 per   k/m";;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;   "jeep") echo "For $rental Rs.5 per   k/m";;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;   "bicycle") echo "For $rental 20 paisa   per k/m";;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;   *) echo "Sorry, I can not gat a $rental for   you";;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;esac&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Save it by pressing CTRL+D&lt;i&gt; &lt;/i&gt;and run it as follows:&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;b&gt;$ chmod +x car&lt;br /&gt;$ car van&lt;br /&gt;$ car car&lt;br /&gt;$ car Maruti-800&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;First script will check, that if $1(first command line argument) is given or not, if NOT given set value of rental variable to "*** Unknown vehicle ***",if command line arg is supplied/given set value of rental variable to given value (command line arg). The $rental is compared against the patterns until a match is found.&lt;br /&gt;For first test run its match with van and it will show output "&lt;i&gt;For van Rs.10 per k/m.&lt;/i&gt;"&lt;br /&gt;For second test run it print, "&lt;i&gt;For car Rs.20 per k/m&lt;/i&gt;".&lt;br /&gt;And for last run, there is no match for Maruti-800, hence default i.e. *) is executed and it prints, "&lt;i&gt;Sorry, I can not gat a Maruti-800 for you&lt;/i&gt;".&lt;br /&gt;&lt;b&gt;Note&lt;/b&gt; that esac is always required to indicate end of case statement.&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;How to de-bug the shell script?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p&gt;While programming shell sometimes you need to find the errors (bugs) in shell script and correct the errors (remove errors - debug). For this purpose you can use -v and -x option with sh or bash command to debug the shell script. General syntax is as follows:&lt;br /&gt;&lt;i&gt;Syntax:&lt;/i&gt;&lt;br /&gt;sh   option   { shell-script-name }&lt;br /&gt;&lt;b&gt;OR&lt;/b&gt;&lt;br /&gt;bash   option   { shell-script-name }&lt;br /&gt;Option can be&lt;br /&gt;&lt;b&gt;-v &lt;/b&gt;Print shell input lines as they are read.&lt;br /&gt;&lt;b&gt;-x &lt;/b&gt;After expanding each simple-command, bash displays the expanded value of PS4 system variable, followed by the command and its expanded arguments.&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Example:&lt;/i&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; width: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="100%" border="0" cellpadding="0" cellspacing="1"&gt;  &lt;tbody&gt;&lt;tr style="height: 91.5pt;"&gt;   &lt;td style="padding: 0.75pt; height: 91.5pt;"&gt;   &lt;p class="MsoNormal"&gt;$ cat &gt; dsh1.sh&lt;br /&gt;  #&lt;br /&gt;  # Script to show debug of shell&lt;br /&gt;  #&lt;br /&gt;  tot=`expr $1 + $2`&lt;br /&gt;  echo $tot&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Press ctrl + d to save, and run it as&lt;br /&gt;&lt;b&gt;$ chmod 755 dsh1.sh&lt;br /&gt;$ ./dsh1.sh 4 5&lt;/b&gt;&lt;br /&gt;&lt;i&gt;9&lt;/i&gt;&lt;br /&gt;&lt;b&gt;$ sh -x dsh1.sh 4 5&lt;/b&gt;&lt;br /&gt;&lt;i&gt;#&lt;br /&gt;# Script to show debug of shell&lt;br /&gt;#&lt;br /&gt;tot=`expr $1 + $2`&lt;br /&gt;expr $1 + $2&lt;br /&gt;++ expr 4 + 5&lt;br /&gt;+ tot=9&lt;br /&gt;echo $tot&lt;br /&gt;+ echo 9&lt;br /&gt;9&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;See the above output, -x shows the exact values of variables (or statements are shown on screen with values).&lt;/p&gt;  &lt;p&gt;&lt;b&gt;$ sh -v dsh1.sh 4 5&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Use -v option to debug complex shell script.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size: 16pt;"&gt;/dev/null - Use to send unwanted output of program&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;p class="MsoNormal"&gt;This is special Linux file which is used to send any unwanted output from program/command.&lt;br /&gt;&lt;i&gt;Syntax:&lt;/i&gt;&lt;br /&gt;command &gt; /dev/null &lt;/p&gt;  &lt;p&gt;&lt;i&gt;Example:&lt;/i&gt;&lt;br /&gt;&lt;b&gt;$ ls &gt; /dev/null&lt;/b&gt;&lt;br /&gt;Output of above command is not shown on screen its send to this special file. The /dev directory contains other device files. The files in this directory mostly represent peripheral devices such disks like floppy disk, sound card, line printers etc. See the &lt;a href="http://www.freeos.com/guides/lsst/appa.html" target="_blank"&gt;&lt;span style=""&gt;file system tutorial&lt;/span&gt;&lt;/a&gt; for more information on Linux disk, partition and file system.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/345201392220129351-3499327250024111342?l=unixfaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixfaq.blogspot.com/feeds/3499327250024111342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=345201392220129351&amp;postID=3499327250024111342' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/3499327250024111342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/3499327250024111342'/><link rel='alternate' type='text/html' href='http://unixfaq.blogspot.com/2008/08/shell-scripting.html' title='Shell Scripting'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-345201392220129351.post-5623142535238325657</id><published>2008-08-06T02:42:00.001-07:00</published><updated>2008-12-23T00:12:05.690-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>BASIC UNIX COMMANDS COMMANDS</title><content type='html'>Commands are what you type at the prompt. Com-&lt;br /&gt;mands have arguments on which they operate. For&lt;br /&gt;example, in rm temp, the command is rm and the ar-&lt;br /&gt;gument is temp; this command removes the le called&lt;br /&gt;temp. Here I put arguments in UPPER CASE. Thus,&lt;br /&gt;words such as FILE are taken to stand for some other&lt;br /&gt;word, such as temp. In the following list, I use [ ] for&lt;br /&gt;optional arguments that are not typicaly used.&lt;br /&gt;Commands have options that are controlled with&lt;br /&gt;switches, which are usually letters following a single&lt;br /&gt;dash. Usually you can write several letters after one&lt;br /&gt;dash. For example ls -l lists les in a long format,&lt;br /&gt;with more information. ls -a lists all the les, in-&lt;br /&gt;cluding those that begin with ., which are usually&lt;br /&gt;les used by various programs. ls -al lists all the&lt;br /&gt;les in the long format. The following list omits most&lt;br /&gt;options. Many programs will give you a list of their&lt;br /&gt;options if you type the name of the program followed&lt;br /&gt;by -h or -?.&lt;br /&gt;Other options are controlled in special les usu-&lt;br /&gt;ally beginning with ., such as .emacs, .mailrc, and&lt;br /&gt;.newsrc. You can edit these. The le .cshrc con-&lt;br /&gt;tains general options, plus aliases that you make up&lt;br /&gt;for commands you use often.&lt;br /&gt;|, the pipe symbol, takes the output of one command&lt;br /&gt;and gives it to the second command as input, for&lt;br /&gt;example, ls -l | more allows you to view a long&lt;br /&gt;le list through \more".&lt;br /&gt;&gt; directs the output to a le, e.g., ls -l &gt;&lt;br /&gt;listing.tmp puts the listing into a le named list-&lt;br /&gt;ing.tmp. &gt; overwrites an old le of the same name.&lt;br /&gt;&gt;&gt; appends to a le.&lt;br /&gt;* stands for any string of letters. For example, ls t*&lt;br /&gt;lists all the les beginning with t.&lt;br /&gt;" recalls previous commands, and you can edit these&lt;br /&gt;commands using emacs editing.&lt;br /&gt;The tab key completes commands if you type the rst&lt;br /&gt;few letters.&lt;br /&gt;ctrl-z suspends most programs. fg resumes. ctrl-c&lt;br /&gt;stops most programs.&lt;br /&gt;alias abbreviates a series of commands, separated&lt;br /&gt;by semicolons. Useful in .cshrc.&lt;br /&gt;GETTING HELP&lt;br /&gt;apropos KEYWORD: Looks for commands related to&lt;br /&gt;KEYWORD.&lt;br /&gt;man COMMAND: Shows manual pages on COMMAND.&lt;br /&gt;This is the authoritative source on the items de-&lt;br /&gt;scribed here. The commands can do much more&lt;br /&gt;than is listed here.&lt;br /&gt;whatis COMMAND: Tells what COMMAND does.&lt;br /&gt;FILES AND DIRECTORIES&lt;br /&gt;All information is stored in les. File names and&lt;br /&gt;commands are case sensitive. Case matters. Files&lt;br /&gt;are contained in directories. You start out in your&lt;br /&gt;own home directory, and your prompt usually tells&lt;br /&gt;its name. At any given time, one of these directories&lt;br /&gt;is your working directory, the one you are in.&lt;br /&gt;You can refer to les in your working directory by&lt;br /&gt;just their names. You can refer to a le that is in a&lt;br /&gt;subdirectory by giving a subdirectory name, a slash,&lt;br /&gt;and the le name, e.g., Mail/baron. You can refer to&lt;br /&gt;any le on the computer by giving its full name, start-&lt;br /&gt;ing with a slash, such as /home7/b/baron/mbox.&lt;br /&gt;If the le is a program, typing its name will run it.&lt;br /&gt;(That is what commands do.) If the program is some-&lt;br /&gt;thing you have just written and is in the director you&lt;br /&gt;are in, put ./ before the name. If the le is not a&lt;br /&gt;program, typing its name will give you an error mes-&lt;br /&gt;sage. If you want to see its contents, for example, you&lt;br /&gt;must use a command such as \more" before the le&lt;br /&gt;name.&lt;br /&gt;ls [DIRECTORY]: Lists les. (Also try: ls -f, ls -s, ls&lt;br /&gt;-a.)&lt;br /&gt;rm FILE: Removes FILE.&lt;br /&gt;more FILE or less FILE: View FILE. (? or h for&lt;br /&gt;help.)&lt;br /&gt;cd DIRECTORY: Change the directory you are in to&lt;br /&gt;DIRECTORY.&lt;br /&gt;cd: Change to your home directory.&lt;br /&gt;cd ..: Change to the next directory up in the hier-&lt;br /&gt;archy.&lt;br /&gt;mkdir DIRECTORY: Make DIRECTORY.&lt;br /&gt;rmdir DIRECTORY: Remove DIRECTORY.&lt;br /&gt;rm -rf: Recursively remove a directory and anything&lt;br /&gt;in it.&lt;br /&gt;mv FILE1 FILE2: Moves or renames FILE1 to&lt;br /&gt;FILE2.&lt;br /&gt;cp FILE1 FILE2: Makes a copy of FILE1, called&lt;br /&gt;FILE2.&lt;br /&gt;cat FILE1 FILE2 &gt; FILE3: Concatenate FILE1&lt;br /&gt;and FILE2, calling the result FILE3.&lt;br /&gt;chmod 644 FILE: Unprotect FILE for others to read&lt;br /&gt;or copy.&lt;br /&gt;chmod 755 FILE: Unprotect program or \script."&lt;br /&gt;chmod 755 DIRECTORY: Unprotect DIRECTORY,&lt;br /&gt;needed for web page directories.&lt;br /&gt;head and tail: Print the top and bottom of a text&lt;br /&gt;le.&lt;br /&gt;TEXT FILE MANIPULATION&lt;br /&gt;These commands operate on les. The output goes&lt;br /&gt;to the \standard output," which is your terminal dis-&lt;br /&gt;play. If you want to \redirect" the output to a le,&lt;br /&gt;use &gt; FILENAME at the end of the command (with&lt;br /&gt;FILENAME being the name of the le). Use &gt;&gt; instead&lt;br /&gt;of &gt; if you want to append to the le rather than&lt;br /&gt;write it from scratch.&lt;br /&gt;diff: Find the dierences between two text les.&lt;br /&gt;grep LETTER-STRING FILE1 [&gt; FILE2]: Prints (or&lt;br /&gt;puts in FILE2) all lines of FILE1 that contain&lt;br /&gt;LETTER-STRING. Use the -v switch to get lines&lt;br /&gt;not containing the string.&lt;br /&gt;sed s/STRING1/STRING2/g: replace STRING1 with&lt;br /&gt;STRING2 throughout a le. See also the y switch&lt;br /&gt;for replacing characters.&lt;br /&gt;cut -d" " -f2 FILE: Extract the second column&lt;br /&gt;from a le, where the columns are delimited by&lt;br /&gt;spaces. Use paste to put such cuttings back to-&lt;br /&gt;gether.&lt;br /&gt;sort FILE: Sort the lines alphabetically.&lt;br /&gt;uniq FILE: Remove adjacent duplicate lines. Typi-&lt;br /&gt;cally used with the output of sort, e.g., sort FILE&lt;br /&gt;| uniq. Use the -c to count the number of ad-&lt;br /&gt;jacent examples of each line.&lt;br /&gt;wc FILE: Count characters, words, and lines.&lt;br /&gt;WHAT'S GOING ON?&lt;br /&gt;w [USER]: Who is using the computer. This is useful&lt;br /&gt;to see whether you are logged on twice. (See ps and&lt;br /&gt;kill, below, in case this happens.) Also try who and&lt;br /&gt;finger.&lt;br /&gt;finger USER: Gives information about the user, in-&lt;br /&gt;cluding the les .project and .plan, if you have&lt;br /&gt;these les. You can sometimes use this for people&lt;br /&gt;on other computers. You can keep useful infor-&lt;br /&gt;mation in your .plan, such as your schedule, your&lt;br /&gt;phone number, etc.&lt;br /&gt;quota -v: Tells you how much of your quota for les&lt;br /&gt;is used up.&lt;br /&gt;ps -fu USERNAME: Lists the processes that you are&lt;br /&gt;running, if you put in your username. You can use&lt;br /&gt;this to nd the number of processes that you want&lt;br /&gt;to kill, such as those left over when you did not&lt;br /&gt;log out properly. It is the rst number listed.&lt;br /&gt;kill PROCESS-NUMBER: Kills the process you don't&lt;br /&gt;want. If this doesn't work, try kill -9&lt;br /&gt;PROCESS-NUMBER.&lt;br /&gt;last -22: Shows you the last 22 users who logged&lt;br /&gt;in.&lt;br /&gt;THE INTERNET&lt;br /&gt;mutt and elm: Read and write electronic mail. Each&lt;br /&gt;has its own \help". See the discussion of these in&lt;br /&gt;the psychology web page computer section.&lt;br /&gt;slrn and tin: Read news (and respond to postings).&lt;br /&gt;Pnews: Post to newsgroups. (You can&lt;br /&gt;also say mutt psych-general@psych or&lt;br /&gt;elm psych-general@psych to post to&lt;br /&gt;upenn.psych.general.)&lt;br /&gt;lynx [URL]: Reads web pages as text les.&lt;br /&gt;ssh HOST: Connects to a remote computer.&lt;br /&gt;talk USERNAME: Allows you to talk with someone&lt;br /&gt;logged on. The full username must be specied&lt;br /&gt;for remote computers, and you must use ntalk&lt;br /&gt;instead of talk. It is not a good idea to use this&lt;br /&gt;casually unless you know that the other person will&lt;br /&gt;not be annoyed.&lt;br /&gt;TRANSFERRING FILES&lt;br /&gt;Many computers on the internet have ftp or ssh, but&lt;br /&gt;all of the programs for transferring les depend on&lt;br /&gt;having the relevant software on both computers.&lt;br /&gt;ftp and scp: Fast way of uploading and down-&lt;br /&gt;loading, or moving any le from one com-&lt;br /&gt;puter to another. For example, scp myfile&lt;br /&gt;baron@psych.upenn.edu: - you need the colon&lt;br /&gt;at the end.&lt;br /&gt;rsync: synchronize les or directories on two dier-&lt;br /&gt;ent computers. Good for backing up.&lt;br /&gt;EDITING&lt;br /&gt;pico FILE or emacs FILE xemacs FILE or vi FILE:&lt;br /&gt;Edit FILE. One of these editors may be specied&lt;br /&gt;as the default for mailing and news programs. Pico&lt;br /&gt;is easiest because it has all the commands listed at&lt;br /&gt;the bottom of the screen, but it is the least useful&lt;br /&gt;because it has few commands.&lt;br /&gt;COMPRESSING, ENCRYPTING, and SE-&lt;br /&gt;CURITY&lt;br /&gt;tar cvf FILE.tar and tar xvf FILE.tar: Create&lt;br /&gt;and extract an archive le. Useful for backing up&lt;br /&gt;directories. On Linux xvfz will extract and unzip&lt;br /&gt;in one step.&lt;br /&gt;gzip FILE: Reduce the size of les for storage. use&lt;br /&gt;gunzip FILE to unzip them. Files \zipped" with&lt;br /&gt;gzip have the sux .gz.&lt;br /&gt;crypt &lt;&gt; FILE2: Encrypts or decodes&lt;br /&gt;le1 so that you need a password to read it. But if&lt;br /&gt;you want to be absolutely sure beyond any doubt&lt;br /&gt;that nobody will read your les, do not leave them&lt;br /&gt;on cattell.&lt;br /&gt;antiword FILE1 &gt; FILE2: Decodes a Word le&lt;br /&gt;into text. (That is all most of them are.) Save&lt;br /&gt;storage space. You can use this with Mutt or Elm&lt;br /&gt;to read doc les sent in email messages.&lt;br /&gt;passwd: Change your password.&lt;br /&gt;Jon Baron, September, 2003&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/345201392220129351-5623142535238325657?l=unixfaq.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixfaq.blogspot.com/feeds/5623142535238325657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=345201392220129351&amp;postID=5623142535238325657' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/5623142535238325657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/345201392220129351/posts/default/5623142535238325657'/><link rel='alternate' type='text/html' href='http://unixfaq.blogspot.com/2008/08/basic-unix-commands-commands.html' title='BASIC UNIX COMMANDS COMMANDS'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-345201392220129351.post-2809857100949691668</id><published>2008-08-06T02:41:00.001-07:00</published><updated>2008-12-23T00:12:05.690-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>commands</title><content type='html'>who &gt; filename  command who will give results and (&gt;) will redirect the standar output to "filename"&lt;br /&gt;wc -l filename  (wc) wordcount will count how many lines in the file&lt;br /&gt;sort &lt; filename  will sort the contain of a filename and display them on screen&lt;br /&gt;sort &lt; filename1 &gt; filename2  will sort the contain of a filename1 and store them in filename2&lt;br /&gt;&lt;br /&gt;set -o vi  to use the vi editor temporarily&lt;br /&gt;set +o vi  to turn off the vi editing mode&lt;br /&gt;vi filename  start using vi in a file&lt;br /&gt;history -3  to display the last 3 command&lt;br /&gt;&lt;br /&gt;echo "Hai"  will display 'Hai'&lt;br /&gt;nama1="yudhi"  assigning 'yudhi' into variabel 'nama1'&lt;br /&gt;nama1=${nama2}  the contain of nama1 will be assigned to variabel nama2&lt;br /&gt;echo $nama1  will display the contain of variabel nama1&lt;br /&gt;expr 1+2  the output will be 3&lt;br /&gt;expr $angka1 + 3  will added the contain of variabel 'angka1' to 3&lt;br /&gt;&lt;br /&gt;UNIX SCRIPT ON CA DAILY ACTIVITY  &lt;br /&gt;&lt;br /&gt;ftp [servername]  file transfer protocol , to GET [filename] or MGET [files] from other server to local server. End session with BYE&lt;br /&gt;file [filename]  to know the specification of current file&lt;br /&gt;ln   to make a link from a file in other directory so it can be executed from current directory (SEE MANUAL)&lt;br /&gt;remsh  to access other server (remote access) and do specific action in the target server (SEE MANUAL)&lt;br /&gt;rcp  to run 'cp' from remote server of a file in other server (SEE MANUAL)&lt;br /&gt;cmviewcl -v  to display the status of nodes and package (SEE MANUAL)&lt;br /&gt;bdf  to display the space status of current server&lt;br /&gt;cmmodpkg -d/-e -n [node] -v [package]  to disable/enable the status of current node (SEE MANUAL) Run the command in current server !&lt;br /&gt;cmrunpkg  to run/down the status of current package (SEE MANUAL)&lt;br /&gt;cmhaltpkg  to halt/stop the status of current package (SEE MANUAL)&lt;br /&gt;haltapp  to reset/stop all the running application on CA server. Run the command from /etc in ivMAC&lt;br /&gt;startapp  to run all the stopping application on CA server. Run the command from /etc in ivMAC&lt;br /&gt;at -f [file] -t [yymmddhhmm]  to schedule files to be executed on spe
