<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Linux from beginning</title>
	<atom:link href="http://linuxfrombeginning.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://linuxfrombeginning.wordpress.com</link>
	<description>My diary of learning linux from day one</description>
	<lastBuildDate>Tue, 30 Sep 2008 08:16:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='linuxfrombeginning.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Linux from beginning</title>
		<link>http://linuxfrombeginning.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://linuxfrombeginning.wordpress.com/osd.xml" title="Linux from beginning" />
	<atom:link rel='hub' href='http://linuxfrombeginning.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Linux Command 14 = ifconfig, ifup, ifdown, ping, traceroute, host, dig</title>
		<link>http://linuxfrombeginning.wordpress.com/2008/09/30/linux-command-14-ifconfig-ifup-ifdown-ping-traceroute-host-dig/</link>
		<comments>http://linuxfrombeginning.wordpress.com/2008/09/30/linux-command-14-ifconfig-ifup-ifdown-ping-traceroute-host-dig/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 08:15:41 +0000</pubDate>
		<dc:creator>linuxlibrary</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dig]]></category>
		<category><![CDATA[host]]></category>
		<category><![CDATA[ifconfig]]></category>
		<category><![CDATA[ifdown]]></category>
		<category><![CDATA[ifup]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux command]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[traceroute]]></category>

		<guid isPermaLink="false">http://linuxfrombeginning.wordpress.com/?p=206</guid>
		<description><![CDATA[1) ifconfig = allows the operating system to setup network interfaces and allow the user to view information about the configured network interfaces Examples ifconfig View the network settings on the Ethernet adapter currently used. ifconfig eth0 View the network settings on the first Ethernet adapter installed in the computer. ifconfig -a Display into on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=206&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1) <strong>ifconfig </strong>= allows the operating              system to setup network interfaces and allow the user to view              information about the configured network interfaces</p>
<p>Examples</p>
<p><strong>ifconfig</strong></p>
<p class="tab">View the network settings on              the Ethernet adapter currently used.</p>
<p class="tab"><strong>ifconfig eth0</strong></p>
<p class="tab">View the network settings on              the first Ethernet adapter installed in the computer.</p>
<p class="tab"><strong>ifconfig -a</strong></p>
<p class="tab">Display into on all network interfaces on server,  			active or inactive.</p>
<p class="tab"><strong>ifconfig eth0 down</strong></p>
<p class="tab">If eth0 exists would take it down causing it cannot  			send or receive any information.</p>
<p class="tab"><strong>ifconfig eth0 up</strong></p>
<p class="tab">If eth0 exists and in the down state would return it  			back to the up state allowing to to send and receive information.</p>
<p class="tab"><strong>ifconfig eth0 192.168.1.102 netmask 255.255.255.0  			broadcast 192.168.1.255</strong></p>
<p class="tab">Assign eth0 with the above values for 			IP, 			netmask and 			broadcast address.</p>
<p class="tab"><span style="color:#ffffff;">.</span></p>
<p class="tab">2) <strong>ifup </strong>= bring a network interface up</p>
<p class="tab"><strong>ifup eth0</strong> &#8211; bring up interface eth0</p>
<p class="tab"><span style="color:#ffffff;">.</span></p>
<p class="tab">3) <strong>ifdown </strong>=  bring a network interfacedown</p>
<p class="tab"><strong>ifdown eth2</strong> &#8211; bring down interface eth2</p>
<p class="tab"><span style="color:#ffffff;">.</span></p>
<p class="tab">4) <strong>ping </strong>= ping allows            a user to ping another network IP address. This can help determine if            the network is able to communicate with the network.</p>
<p class="tab">Example:</p>
<p><strong>ping gmail.com</strong> &#8211; Would ping the gmailhost .com to see if it is alive.</p>
<p><strong>ping gmail.com -c 1</strong> &#8211; Would ping the hgmailost .com once and return to the command line</p>
<p><span style="color:#ffffff;">.</span></p>
<p>5) <strong>traceroute </strong>= print the route packets take to network host</p>
<p>Examples:</p>
<p><strong>$ traceroute google.co.in</strong> &#8212; Trace the route for Google Server.</p>
<p><strong>$ traceroute -v 192.168.12.1 </strong>&#8211; Show more details.</p>
<p><strong>$ traceroute -n server</strong> &#8212; Print the HOP Address in numeric form.<br />
<strong><br />
$ traceroute -I server</strong> &#8212; Use ICMP ECHO instead of UDP datagrams.<br />
<strong><br />
$ tracerout</strong>e<strong> -i eth1 serve</strong>r &#8212; Use eth1 for send the probe packets.<br />
<strong><br />
$ traceroute server 100</strong> &#8212; Sent 100 Bytes packet instead of default 40 Bytes packet.</p>
<p>6) <strong>host </strong>= simple utility for performing DNS (Domain Name Service) lookups.  It is normally used to convert names to IP addresses and vice versa</p>
<p>Examples:</p>
<p><strong>$ host google.com</strong> &#8212; Show the IP Address of Google.com.</p>
<p><strong>$ host -v google.com</strong> &#8212; Show detailed output.</p>
<p><strong>$ host -a google.com</strong> &#8212; Show more details.</p>
<p><strong>$ host 127.0.0.1</strong> &#8212; Do reverse lookup and Show the host name.</p>
<p><strong>$ host -l mydomain.com</strong> &#8212; List all hosts available in MyDomain.</p>
<p><span style="color:#ffffff;">.</span></p>
<p>7) <strong>dig </strong>= DNS lookup utility</p>
<p>Ecamples:</p>
<p><strong>dig yahoo.com</strong></p>
<p><strong>dig 66.94.234.13</strong></p>
<p><strong>dig -x 192.168.52.</strong></p>
<p><strong>dig -t ANY yahoo.com</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linuxfrombeginning.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linuxfrombeginning.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linuxfrombeginning.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linuxfrombeginning.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linuxfrombeginning.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linuxfrombeginning.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linuxfrombeginning.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linuxfrombeginning.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linuxfrombeginning.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linuxfrombeginning.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linuxfrombeginning.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linuxfrombeginning.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linuxfrombeginning.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linuxfrombeginning.wordpress.com/206/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=206&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linuxfrombeginning.wordpress.com/2008/09/30/linux-command-14-ifconfig-ifup-ifdown-ping-traceroute-host-dig/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40aa09b66c9a8cfa43bb39ef2a9d7d60?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxlibrary</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Command 13 &#8211; jobs, bg, fg, nice, renice, at, top</title>
		<link>http://linuxfrombeginning.wordpress.com/2008/09/29/linux-command-13-jobs-bg-fg-top/</link>
		<comments>http://linuxfrombeginning.wordpress.com/2008/09/29/linux-command-13-jobs-bg-fg-top/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 00:33:09 +0000</pubDate>
		<dc:creator>linuxlibrary</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[at]]></category>
		<category><![CDATA[bg]]></category>
		<category><![CDATA[fg]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[linux command]]></category>
		<category><![CDATA[nice]]></category>
		<category><![CDATA[renice]]></category>
		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://linuxfrombeginning.wordpress.com/?p=200</guid>
		<description><![CDATA[1) jobs = lists the jobs that you are running in the background and in the foreground Syntax jobs [-p &#124; -l] [-n] [-p] [-x] [job id] If the prompt is returned with no information no jobs are present jobs -p : list only the PID of process group leader jobs -l : list only [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=200&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1) <strong>jobs </strong>= lists the jobs that you are             running in the background and in the foreground</p>
<p>Syntax</p>
<p><strong><em>jobs [-p | -l] [-n] [-p]             [-x] [job id]</em></strong></p>
<p>If the prompt is               returned with no information no jobs are present</p>
<p><strong>jobs -p</strong> : list only the PID of process group leader</p>
<p><strong>jobs -l </strong>: list only jobs that have change status since last notified by their status</p>
<p><strong>jobs -r</strong> : resrict output to running jobs</p>
<p><strong>jobs &#8211; s </strong>: restrict output to stopped jobs</p>
<p><span style="color:#ffffff;">.</span></p>
<p>2) <strong>bg </strong>= place a job in background</p>
<p>Normally user can run a job in background, by adding &amp; at end of the<br />
command (ex: sleep 10 &amp;).</p>
<p>bg is a shell command. It is used to move a job from foreground to the<br />
background, as if it had been started with `&amp;&#8217;. If JOB is not present,<br />
the shell&#8217;s notion of the current job is used.</p>
<p>Examples (follow all the steps below)</p>
<p>a)<strong> $ sleep 100</strong> &#8212; Start a dummy job in foreground.   (sleep = waits a <em>x</em> amount of             second)<br />
Press Ctrl+z to stop the current job.</p>
<p>b)<strong> </strong><strong>$ bg &#8212; Move the last stopped job to background.</strong></p>
<p>c)<strong> $ sleep 150</strong> &#8212; Dummy job 1<br />
Press Ctrl+z to stop the current job.<br />
<strong><br />
</strong>d)<strong> $ sleep 140</strong> &#8212; Dummy job 2<br />
Press Ctrl+z to stop the current job.</p>
<p>e)<strong> $ sleep 130</strong> &#8212; Dummy job 3<br />
Press Ctrl+z to stop the current job.<br />
<strong><br />
</strong>f)<strong> $ jobs</strong> &#8212; List all active jobs.</p>
<p>g)<strong> $ bg 2</strong> &#8212; Move the 2nd active job to background.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><span style="color:#ffffff;">.</span>3) <strong>fg </strong>= continues a               stopped job by             running it in the foreground</p>
<p>Examples</p>
<p><strong>fg</strong> &#8211; Typing fg alone will resume the first job               were it was left off.</p>
<p><strong>fg 1</strong> &#8211; specifying the job (in this case 1) will               resume that particular job. The job id can be determined by running               bg</p>
<p><span style="color:#ffffff;">.</span></p>
<p>4) <strong>nice </strong>= run a command with modified priority</p>
<p>nice command is used to run the given command with its scheduling<br />
priority adjusted. Priority range goes from -20 (highest priority)<br />
to 19 (lowest priority).</p>
<p>Examples:</p>
<p>$ <strong>nice </strong>&#8211; Prints the current priority value.</p>
<p>$ <strong>nice ls</strong> &#8212; Increment the priority value of the ls command<br />
by 10 (Default value) and run.</p>
<p>$ <strong>nice -n 5 ls</strong> &#8212; Increment the priority value of the ls command<br />
by 5 and run.</p>
<p># <strong>nice -n -2 ls</strong> &#8212; Decrement the priority value of the ls command by<br />
-2 and run.</p>
<p>NOTE: Incrementing the priority value will reduce the priority level<br />
and vice versa. Priority range is -20 (high) to 19 (low).</p>
<p><span style="color:#ffffff;">.</span></p>
<p>5) <strong>renice </strong>= renice is used to alters the scheduling priority of one or more<br />
running processes, priority range goes from -20 (highest priority)<br />
to 19 (lowest priority).</p>
<p>Examples:</p>
<p>$ <strong>renice +1 123</strong> &#8212; Increment the priority value of a process, which<br />
process ID is 123.</p>
<p># <strong>renice +1 123 </strong>&#8211; Decrement the priority value of a process, which<br />
process ID is 123. (Root only can decrement ).</p>
<p>$ <strong>renice +1 -p 123 -p 200</strong> &#8212; Same as above. Here no. of process is 2.</p>
<p>$ <strong>renice +1 -u sbharathi </strong>&#8211; Increment the priority value of all<br />
processes, which is owned by a user (sbharathi).</p>
<p>$ <strong>renice +1 -g backup</strong> &#8212; Increment the priority value of all<br />
processes, which is owned by a group (backup).</p>
<p>NOTE: Incrementing the priority value will reduce the priority level<br />
and vice versa. Priority range is -20 (high) to 19 (low).</p>
<p><span style="color:#ffffff;">.</span></p>
<p>6) <strong>at </strong>= schedules a command to be ran at             a particular time, such as a print job late at night</p>
<p>Syntax<br />
<strong>at</strong> -  executes commands at a specified time.<br />
<strong>atq </strong>- lists the user&#8217;s pending jobs, unless the user is the superuser; in that case, everybody&#8217;s jobs are listed. The format of the output lines (one for each job) is: Job number, date, hour, job class.<br />
<strong>atrm </strong>-  deletes jobs, identified by their job number.<br />
<strong>batch </strong>- executes commands when system load levels permit; in other words, when the load average drops below 1.5, or the value specified in the invocation of atrun.</p>
<p><strong><a name="03"></a></strong>Examples</p>
<p><strong>at -m 01:35 &lt; atjob = </strong>Run the commands               listed in the &#8216;atjob&#8217; file at 1:35AM, in addition all output that               is generated from job mail to the user running the task. When this               command has been successfully enter you should receive a prompt               similar to the below example.</p>
<blockquote><p>commands will be executed using /bin/csh<br />
job 1072250520.a at Wed Dec 24 00:22:00 2003</p></blockquote>
<p><strong>at -l = </strong>This command will list each of the               scheduled jobs as seen below.</p>
<blockquote><p>1072250520.a    Wed Dec 24 00:22:00 2003</p></blockquote>
<p><strong>at -r 1072250520.a</strong> = Deletes the job just               created.</p>
<p>or</p>
<p><strong>atrm 23</strong> = Deletes job 23.</p>
<p>If you wish to create a job that is               repeated you could modify the file that executes the commands with               another command that recreates the job or better yet use the crontab               command.<strong></strong></p>
<p><strong>Note:</strong> Performing just the <strong>at</strong> command at the prompt will give you an error &#8220;Garbled                 Time&#8221;, this is a standard error message if no switch or                 time setting is given.</p>
<p><span style="color:#ffffff;">.</span></p>
<p>7) <strong>top </strong>= provide information (frequently refreshed) about the most CPU-intensive processes currently running</p>
<p><a href="http://linuxfrombeginning.files.wordpress.com/2008/09/300px-3-2-7-top.png"><img class="aligncenter size-full wp-image-201" title="300px-3-2-7-top" src="http://linuxfrombeginning.files.wordpress.com/2008/09/300px-3-2-7-top.png?w=510" alt=""   /></a></p>
<div class="content">
<p><strong>Description of the fields</strong></p>
<dl>
<dt>a: PID  &#8212;  Process Id</dt>
<dd>The task&#8217;s unique process ID, which periodically wraps, though never restarting at zero.</dd>
<dt>b: PPID  &#8212;  Parent Process Pid</dt>
<dd>The process ID of a task&#8217;s parent.</dd>
<dt>c: RUSER  &#8212;  Real User Name</dt>
<dd>The real user name of the task&#8217;s owner.</dd>
</dl>
<div class="content">
<dt>d: UID  &#8212;  User Id</dt>
<dd>The effective user ID of the task&#8217;s owner.</dd>
<dt>e: USER  &#8212;  User Name</dt>
<dd>The effective user name of the task&#8217;s owner.</dd>
<dt>f: GROUP  &#8212;  Group Name</dt>
<dd>The effective group name of the task&#8217;s owner.</dd>
<dt>g: TTY  &#8212;  Controlling Tty</dt>
<dd>The name of the controlling terminal. This is usually the device (serial port, pty, etc.) from which the process was started, and which it uses for input or output. However, a task need not be associated with a terminal, in which case you&#8217;ll see &#8216;?&#8217; displayed.</dd>
<dt>h: PR  &#8212;  Priority</dt>
<dd>The priority of the task.</dd>
<dt>i: NI  &#8212;  Nice value</dt>
<dd>The nice value of the task. A negative nice value means higher priority, whereas a positive nice value means lower priority. Zero in this field simply means priority will not be adjusted in determining a task&#8217;s dispatchability./dd&gt; </dd>
<dt>j: P  &#8212;  Last used CPU (SMP)</dt>
<dd>A number representing the last used processor. In a true SMP environment this will likely change frequently since the kernel intentionally uses weak affinity. Also, the very act of running top may break this weak affinity and cause more processes to change CPUs more often (because of the extra demand for cpu time).</dd>
<dt>k: %CPU  &#8212;  CPU usage</dt>
<dd>The task&#8217;s share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time. In a true SMP environment, if &#8216;Irix mode&#8217; is Off, top will operate in &#8216;Solaris mode&#8217; where a task&#8217;s cpu usage will be divided by the total number of CPUs. You toggle &#8216;Irix/Solaris&#8217; modes with the &#8216;I&#8217; interactive command.</dd>
<dt>l: TIME  &#8212;  CPU Time</dt>
<dd>Total CPU time the task has used since it started. When &#8216;Cumulative mode&#8217; is On, each process is listed with the cpu time that it and its dead children has used. You toggle &#8216;Cumulative mode&#8217; with &#8216;S&#8217;, which is a command-line option and an interactive command. See the &#8216;S&#8217; interactive command for additional information regarding this mode.</dd>
<dt>m: TIME+  &#8212;  CPU Time, hundredths</dt>
<dd>The same as &#8216;TIME&#8217;, but reflecting  more  granularity  through  hundredths of a second.</dd>
<dt>n: %MEM  &#8212;  Memory usage (RES)</dt>
<dd>A task&#8217;s currently used share of available physical memory.</dd>
<dt>o: VIRT  &#8212;  Virtual Image (kb)</dt>
<dd>The total amount of virtual memory used by the task. It includes all code, data and shared libraries plus pages that have been swapped out.</dd>
<p>VIRT = SWAP + RES.</p>
<dt>p: SWAP  &#8212;  Swapped size (kb)</dt>
<dd>The swapped out portion of a task&#8217;s total virtual memory image.</dd>
<dt>q: RES  &#8212;  Resident size (kb)</dt>
<dd>The non-swapped physical memory a task has used.</dd>
<p>RES = CODE + DATA.</p>
<dt>r: CODE  &#8212;  Code size (kb)</dt>
<dd>The amount of physical memory devoted to executable code, also known as the &#8216;text resident set&#8217; size or TRS.</dd>
<dt>s: DATA  &#8212;  Data+Stack size (kb)</dt>
<dd>The amount of physical memory devoted to other than executable code, also known as the &#8216;data resident set&#8217; size or DRS.</dd>
<dt>t: SHR  &#8212;  Shared Mem size (kb)</dt>
<dd>The amount of shared memory used by a task.  It simply reflects memory that could be potentially shared with other processes.</dd>
<dt>u: nFLT  &#8212;  Page Fault count</dt>
<dd>The number of major page faults that have occurred for a task. A page fault occurs when a process attempts to read from or write to a virtual page that is not currently present in its address space. A major page fault is when disk access is involved in making that page available.</dd>
<dt>v: nDRT  &#8212;  Dirty Pages count</dt>
<dd>The number of pages that have been modified since they were last written to disk. Dirty pages must be written to disk before the corresponding physical memory location can be used for some other virtual page.</dd>
<dt>w: S  &#8212;  Process Status</dt>
<dd>The status of the task which can be one of:<br />
&#8216;D&#8217; = uninterruptible sleep<br />
&#8216;R&#8217; = running<br />
&#8216;S&#8217; = sleeping<br />
&#8216;T&#8217; = traced or stopped<br />
&#8216;Z&#8217; = zombieTasks shown as running should be more properly thought of as &#8216;ready to run&#8217; &#8212; their task_struct is simply represented on the Linux run-queue. Even without a true SMP machine, you may see numerous tasks in this state depending on top&#8217;s delay interval and nice value. </dd>
<dt>x: Command  &#8212;  Command line or Program name</dt>
<dd>Display the command line used to start a task or the name of the associated program. You toggle between command line and name with &#8216;c&#8217;, which is both a command-line option and an interactive command.When you&#8217;ve chosen to display command lines, processes without a command line (like kernel threads) will be shown with only the program name in parentheses, as in this example:( mdrecoveryd )</p>
<p>Either form of display is subject to potential truncation if it&#8217;s too long to fit in this field&#8217;s current width. That width depends upon other fields selected, their order and the current screen width.</p>
<p>Note: The &#8216;Command&#8217; field/column is unique, in that it is not fixed-width. When displayed, this column will be allocated all remaining screen width (up to the maximum 512 characters) to provide for the potential growth of program names into command lines.</p>
</dd>
<dt>y: WCHAN  &#8212;  Sleeping in Function</dt>
<dd>Depending on the availability of the kernel link map (&#8216;System.map&#8217;), this field will show the name or the address of the kernel function in which the task is currently sleeping. Running tasks will display a dash (&#8216;-&#8217;) in this column.Note:  By  displaying  this  field,  top&#8217;s  own  working set will be<br />
increased by over 700Kb.  Your only means of reducing that  overhead<br />
will be to stop and restart top. </dd>
<dt>z: Flags  &#8212;  Task Flags</dt>
<dd>This column represents the task&#8217;s current scheduling flags which are expressed in hexadecimal notation and with zeros suppressed. These flags are officially documented in . Less formal documentation can also be found on the &#8216;Fields select&#8217; and &#8216;Order fields&#8217; screens.</dd>
<dd>
</dd>
<p><span style="color:#ffffff;">.</span></p>
<p><strong>Interactive commands</strong></p>
<p>While top is running you may issue some options that will interact immediately with top these options are:</p>
<dl>
<dt>h</dt>
<dd>Help, displays a summary of command that will modify the behavior of top</dd>
<dt>k</dt>
<dd>Kills a process, you will be able to kill only your own processes, unless you are running top as root</dd>
<dt>n</dt>
<dd>Once this command is entered top will ask you how many lines you want on your screen, if you enter 0 top will display as much as it can</dd>
<dt>q</dt>
<dd>Exits top</dd>
<dt>r</dt>
<dd>Change the priority of a process, as well as with <em>k</em> you will only be able to act on your own processes unless you are root</dd>
<dt>W</dt>
<dd>Writes the current configuration to your personal configuration file, which is $HOME/.toprc</dd>
</dl>
</div>
<dd>
</dd>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linuxfrombeginning.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linuxfrombeginning.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linuxfrombeginning.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linuxfrombeginning.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linuxfrombeginning.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linuxfrombeginning.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linuxfrombeginning.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linuxfrombeginning.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linuxfrombeginning.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linuxfrombeginning.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linuxfrombeginning.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linuxfrombeginning.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linuxfrombeginning.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linuxfrombeginning.wordpress.com/200/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=200&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linuxfrombeginning.wordpress.com/2008/09/29/linux-command-13-jobs-bg-fg-top/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40aa09b66c9a8cfa43bb39ef2a9d7d60?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxlibrary</media:title>
		</media:content>

		<media:content url="http://linuxfrombeginning.files.wordpress.com/2008/09/300px-3-2-7-top.png" medium="image">
			<media:title type="html">300px-3-2-7-top</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Command 12 &#8211;  ps, ptree, pgrep, pidof, pkill, kill, killall</title>
		<link>http://linuxfrombeginning.wordpress.com/2008/09/28/linux-command-12-ps-ptree-pgrep-pidof-pkill-kill-killall/</link>
		<comments>http://linuxfrombeginning.wordpress.com/2008/09/28/linux-command-12-ps-ptree-pgrep-pidof-pkill-kill-killall/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 17:28:52 +0000</pubDate>
		<dc:creator>linuxlibrary</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[kill]]></category>
		<category><![CDATA[killall]]></category>
		<category><![CDATA[linux command]]></category>
		<category><![CDATA[pgrep]]></category>
		<category><![CDATA[pidof]]></category>
		<category><![CDATA[pkill]]></category>
		<category><![CDATA[ps]]></category>
		<category><![CDATA[ptree]]></category>

		<guid isPermaLink="false">http://linuxfrombeginning.wordpress.com/?p=194</guid>
		<description><![CDATA[1) ps = report process status ps : typing ps alone would list the current running processes ps -u username : to search processes run by a certain user ps ag : to get information about all running process ps aux : to display the owner of the processes along with the processes ps ax [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=194&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1) <strong>ps </strong>= report process status</p>
<p><strong>ps </strong>: typing ps alone would list the current running               processes</p>
<p><strong>ps -u username</strong> : to search processes run by a certain user</p>
<p><strong>ps ag : </strong>to get information about all running process</p>
<p><strong>ps aux</strong> : to display the owner of the processes along with the processes</p>
<p><strong>ps ax | grep  processname</strong> : to see if a particular process is running or not</p>
<p><span style="color:#ffffff;">.</span></p>
<p>2) <strong>ptree </strong>: to display a tree of processeses</p>
<p><strong>pstree -p | less</strong> : also display the pid of the process</p>
<p><span style="color:#ffffff;">.</span></p>
<p>3) <strong>pgrep</strong> : look up or signal processes based on name and other attributes</p>
<p><strong>pgrep sshd</strong> : to list the processes called sshd</p>
<p><strong>pgrep -u root sshd</strong> : will only list the processes called sshd AND owned by root</p>
<p><strong>pgrep -u root,daemon</strong> : will list the processes owned by root OR daemon</p>
<p><span style="color:#ffffff;">.</span></p>
<p>4) <strong>pidof </strong>&#8211; find the process ID of a running program</p>
<p><strong>pidof emacs</strong> &#8211; list the process id for emacs</p>
<p>pgrep and pidof is much the same except that grep is more powerful it has more options (check man pages for both)</p>
<p><span style="color:#ffffff;">.</span></p>
<p>5) <strong>pkill </strong>= kill all processes matching the search text</p>
<p><strong>pkill sshd </strong>: kill all sshd processes</p>
<p><strong>pkill -9 –u userlogin</strong> : kill a process owned by a particular user</p>
<p><span style="color:#ffffff;">.</span></p>
<p>6) <strong>kill </strong>= Send a signal to terminate one or more process IDs</p>
<p><strong>kill 2345</strong> : terminate process 2345 (to list process id use ps)</p>
<p><strong>kill -9 2345</strong> : if kill 2345 doesnt work, use kill -9 2345 to force it</p>
<p><span style="color:#ffffff;">.</span></p>
<p>7) <strong>killall </strong>= kill all processes by name</p>
<p><strong>killall nautilus</strong></p>
<p>Unlike the kill command, it is not necessary to first try to find the PID(s) for nautilus. And if there are multiple instances of nautilus running, all will be terminated immediately.</p>
<p>killall is similar to pkill</p>
<pre><strong><strong>
</strong></strong></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linuxfrombeginning.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linuxfrombeginning.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linuxfrombeginning.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linuxfrombeginning.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linuxfrombeginning.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linuxfrombeginning.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linuxfrombeginning.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linuxfrombeginning.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linuxfrombeginning.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linuxfrombeginning.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linuxfrombeginning.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linuxfrombeginning.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linuxfrombeginning.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linuxfrombeginning.wordpress.com/194/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=194&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linuxfrombeginning.wordpress.com/2008/09/28/linux-command-12-ps-ptree-pgrep-pidof-pkill-kill-killall/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40aa09b66c9a8cfa43bb39ef2a9d7d60?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxlibrary</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Command 11 &#8211; useradd, userdel, usermod, groupadd, last, lastb</title>
		<link>http://linuxfrombeginning.wordpress.com/2008/09/27/linux-command-11-useradd-userdel-usermod-groupadd-last-lastb/</link>
		<comments>http://linuxfrombeginning.wordpress.com/2008/09/27/linux-command-11-useradd-userdel-usermod-groupadd-last-lastb/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 11:40:38 +0000</pubDate>
		<dc:creator>linuxlibrary</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[groupadd]]></category>
		<category><![CDATA[last]]></category>
		<category><![CDATA[lastb]]></category>
		<category><![CDATA[useradd]]></category>
		<category><![CDATA[userdel]]></category>
		<category><![CDATA[usermod]]></category>

		<guid isPermaLink="false">http://linuxfrombeginning.wordpress.com/?p=184</guid>
		<description><![CDATA[1) useradd = create a new user or updates default new user information Usage: useradd login options Examples: # useradd usr1 &#8212; Add new user usr1 with default settings # useradd usr1 -d /home/usr1 &#8212; Create the new user&#8217;s home dir in /home # useradd usr1 -e 2009-04-30 &#8212; From 30/4/2009 the user acc will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=184&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1) <strong>useradd </strong>= create a new user or updates default new user               information</p>
<p>Usage:</p>
<p>useradd login options</p>
<p>Examples:</p>
<p># <strong>useradd usr1</strong> &#8212; Add new user usr1 with default settings</p>
<p># <strong>useradd usr1</strong><strong> -d /home/usr1</strong> &#8212; Create the new user&#8217;s home dir in /home</p>
<p># <strong>useradd usr1</strong> <strong>-e 2009-04-30</strong> &#8212; From 30/4/2009 the user acc will be disabled.</p>
<p># <strong>useradd usr1 -f 6</strong> &#8212; After passwd expires, system will allow the user to login for 6 days with a warning to change his passwd.</p>
<p># <strong>useradd usr1 -g staff </strong> &#8212; Set user1 group as staff</p>
<p># <strong>useradd usr1 -p $1$d8</strong> &#8212; Create the usr1 with the given encrypted password. For No passwd, acc disabled.</p>
<p># <strong>useradd usr1 -s /bin/csh</strong> &#8212; Set C Shell as the default login shell for the usr1</p>
<p><span style="color:#ffffff;">.</span></p>
<p>2) <strong>userdel </strong>= delete a user account and user&#8217;s related files <a name="lbAC"></a></p>
<p><strong>userdel login</strong><strong>name &#8211; </strong>delete the user account<strong><br />
</strong></p>
<p><strong>userdel -r loginname </strong>- delete the user account together with user&#8217;s home directory and all files inside it</p>
<p><strong>userdel -f </strong><strong>loginname</strong> &#8211; for the deletion even the user is still log in, it will force to delete the user&#8217;s home directory and files as well, this option is dangerous use with caution</p>
<p><span style="color:#ffffff;">.</span></p>
<p>3) <strong>usermod </strong>= to modify a               users account</p>
<p>Examples:</p>
<p><strong># usermod -d /home2/usr1 usr1</strong> &#8212; Create the new home Dir for usr1 in /home2 &amp; Move old Dir contents to this Dir.</p>
<p><strong># usermod -e 2005-04-30 usr1</strong> &#8212; From 30/4/2005 the usr1 acc will be disabled.</p>
<p><strong># usermod -f 6 usr1</strong> &#8212; After passwd expires, system will allow the user to login for 6 days with a warning to change his passwd.<br />
<strong><br />
# usermod -g prof usr1</strong> &#8212; Set usr1&#8242;s initial group as prof.</p>
<p><strong># usermod -p $1$d8 usr1</strong> &#8212; Set the new passwd for the usr1</p>
<p><strong># usermod -s /bin/bash usr1</strong> &#8212; Set Bash as the default login shell for the usr1.</p>
<p><strong># usermod -L usr1</strong> &#8212; Lock a user&#8217;s password.</p>
<p><strong># usermod -U usr1</strong> &#8212; Unlock a user&#8217;s password.</p>
<p><span style="color:#ffffff;">.</span></p>
<p>4) groupadd = create a new group</p>
<p><strong># </strong><strong>groupadd sales</strong></p>
<p><span style="color:#ffffff;">.</span></p>
<p>5) <strong>last</strong> = show listing of last logged in users    <a name="lbAC"><br />
</a></p>
<p><a name="lbAE"></a></p>
<p>Examples:</p>
<p><strong>$ las</strong>t &#8212; List all entries.</p>
<p><strong>$ last tty6</strong> &#8212; List, who are all logged thru tty6.</p>
<p><strong>$ last bharathi</strong> &#8212; List all entries of bharathi (user).</p>
<p><strong>$ last -6</strong> &#8212; List only last 6 entries.<br />
<strong><br />
$ last -R</strong> &#8212; Don&#8217;t show the Host Name field in output.</p>
<p><strong>$ last -a </strong>&#8211; Show Host Name field in last column.</p>
<p><strong>$ last -i </strong>&#8211; Show IP Number for Remote host.</p>
<p><strong>$ last -t 20080818120000</strong> &#8212; List all entries upto Aug 18 12:00:00 2008</p>
<p><span style="color:#ffffff;">.</span></p>
<p>6) <strong>lastb </strong>= display a list of recent bad login attempts (from the <em>/var/log/btmp</em> file). Accepts the same option flags and arguments as last</p>
<p><strong><br />
</strong><strong></strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linuxfrombeginning.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linuxfrombeginning.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linuxfrombeginning.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linuxfrombeginning.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linuxfrombeginning.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linuxfrombeginning.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linuxfrombeginning.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linuxfrombeginning.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linuxfrombeginning.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linuxfrombeginning.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linuxfrombeginning.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linuxfrombeginning.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linuxfrombeginning.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linuxfrombeginning.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=184&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linuxfrombeginning.wordpress.com/2008/09/27/linux-command-11-useradd-userdel-usermod-groupadd-last-lastb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40aa09b66c9a8cfa43bb39ef2a9d7d60?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxlibrary</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Keyboard Shortcuts for Command Line : tab key, ctrl+R, !string and !num, tilde (`), command editing tricks</title>
		<link>http://linuxfrombeginning.wordpress.com/2008/09/26/linux-keyboard-shortcuts-for-command-line-tab-key-ctrlr-string-and-num-tilde-command-editing-tricks/</link>
		<comments>http://linuxfrombeginning.wordpress.com/2008/09/26/linux-keyboard-shortcuts-for-command-line-tab-key-ctrlr-string-and-num-tilde-command-editing-tricks/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 07:58:08 +0000</pubDate>
		<dc:creator>linuxlibrary</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[!num]]></category>
		<category><![CDATA[!string]]></category>
		<category><![CDATA[command editing tricks]]></category>
		<category><![CDATA[ctrl+R]]></category>
		<category><![CDATA[keyboard shortcut]]></category>
		<category><![CDATA[linux shortcut]]></category>
		<category><![CDATA[tab key]]></category>
		<category><![CDATA[tilde (`)]]></category>

		<guid isPermaLink="false">http://linuxfrombeginning.wordpress.com/?p=179</guid>
		<description><![CDATA[1) Tab key = to complete a file name. very useful for long file name ls &#60;enter&#62; finance-report-june-2008  sales-report-june-2008  engineering-report-june-2008 if i want to open finance report i can just type more fi&#60;tab&#62;, it will auto complete the filename become more finance-report-june-2008 . 2) Ctrl+R = to search for a keyword in history . 3) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=179&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1) <strong>Tab key</strong> = to complete a file name. very useful for long file name</p>
<p><strong>ls &lt;enter&gt;</strong></p>
<p>finance-report-june-2008  sales-report-june-2008  engineering-report-june-2008</p>
<p>if i want to open finance report i can just type <strong></strong></p>
<p><strong>more fi&lt;tab&gt;</strong>, it will auto complete the filename become <strong>more finance-report-june-2008</strong></p>
<p><span style="color:#ffffff;">.</span></p>
<p>2)<strong> Ctrl+R</strong> = to search for a keyword in history</p>
<p><span style="color:#ffffff;">.</span></p>
<p>3) <strong>!string and  !num</strong> = to perform previous action in history</p>
<p>Example for !string</p>
<p><strong>!ssh &lt;enter&gt;</strong></p>
<p>it will perform previous command in history <strong>ssh 122.456.789.123 -l mylogin</strong></p>
<p><span style="color:#ffffff;">.</span></p>
<p>Example for !num</p>
<p>type <strong>history </strong>to see all the previous commands, you can see for each command is assigned an id</p>
<p><strong>!54 &lt;enter&gt; </strong> ( ! followed by the id number)</p>
<p>it will perform the command in history with id number 54</p>
<p><span style="color:#ffffff;">.</span></p>
<p>4) <strong>Tilde (~)</strong> = shortcut to home directory</p>
<p><strong>cat ~/.bash_profile </strong></p>
<p>to refer to your own directory</p>
<p><strong>cat ~julie/public_html</strong></p>
<p>to refer to another user&#8217;s home directory</p>
<p><span style="color:#ffffff;">.</span></p>
<p>5) <strong>Command editing Tricks </strong></p>
<p>There are many but i find these are the most useful</p>
<p><strong>Ctrl + a</strong> = moves to beginning of line</p>
<p><strong>Ctrl + e</strong> = moves to end of line</p>
<p><strong>Ctrl + w</strong> = deletes the word before the cursor</p>
<p><strong>Ctrl + u</strong> = deletes to beginning of line</p>
<p><strong>Ctrl + k</strong> = deletes to end of line</p>
<p><strong>Ctrl + y</strong> = undo a deletion</p>
<p><strong>Alt + b</strong> = moves to beginning of line word by word</p>
<p><strong>Alt + f </strong>= moves to end of line word by word</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linuxfrombeginning.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linuxfrombeginning.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linuxfrombeginning.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linuxfrombeginning.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linuxfrombeginning.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linuxfrombeginning.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linuxfrombeginning.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linuxfrombeginning.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linuxfrombeginning.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linuxfrombeginning.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linuxfrombeginning.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linuxfrombeginning.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linuxfrombeginning.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linuxfrombeginning.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=179&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linuxfrombeginning.wordpress.com/2008/09/26/linux-keyboard-shortcuts-for-command-line-tab-key-ctrlr-string-and-num-tilde-command-editing-tricks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40aa09b66c9a8cfa43bb39ef2a9d7d60?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxlibrary</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Command 10 : su, su -, sudo, wc, cut, diff</title>
		<link>http://linuxfrombeginning.wordpress.com/2008/09/26/linux-command-10-su-su-sudo-wc-cut-diff/</link>
		<comments>http://linuxfrombeginning.wordpress.com/2008/09/26/linux-command-10-su-su-sudo-wc-cut-diff/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 00:34:20 +0000</pubDate>
		<dc:creator>linuxlibrary</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cut]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[linux command]]></category>
		<category><![CDATA[su]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[wc]]></category>

		<guid isPermaLink="false">http://linuxfrombeginning.wordpress.com/?p=172</guid>
		<description><![CDATA[1) su = become super user or another user Examples: I already login as a normal user. To switch to root I can type su &#60;enter&#62; : it will ask for root password then will log in to root account but maintaining the user environment su root &#60;enter&#62; : same as above su &#8211; &#60;enter&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=172&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1) <strong>su </strong>= become super user or another user</p>
<p>Examples:</p>
<p>I already login as a normal user. To switch to root I can type</p>
<p><strong>su &lt;enter&gt;</strong> : it will ask for root password then will log in to root account but maintaining the user environment</p>
<p><strong>su root</strong> <strong>&lt;enter&gt;</strong> : same as above</p>
<p><strong>su &#8211; &lt;enter&gt;</strong> : after entering the root password it will log in to root account with root environment (processing all login scripts)</p>
<p><strong>su &#8211; david &lt;enter&gt;</strong> : login to david&#8217;s account with david&#8217;s environment</p>
<p>The difference between su and su &#8211; is one will maintain the user environment while the other will use the new user environment</p>
<p><span style="color:#ffffff;">.</span></p>
<p>2) <strong>sudo </strong>= execute a command as another user, as specified in the <em>sudoers</em> file.</p>
<p>a) by default, sudo requires that users authenticate themselves with a password (not root password)</p>
<p>b) sudo determines who is an authorized user by consulting the file /etc/sudoers. the login access have to be created by root user in this file</p>
<p>c) basically sudo is used to give access to superusers to do administrative job without them login using root account, so monitoring of each task done by many administrators can be recorded properly</p>
<p>Examples:</p>
<p><strong>sudo more /etc/sudoers</strong> : in order to view a content where the user has no access, he can use sudo</p>
<p><strong>sudo shutdown -h now</strong> : to shutdown a machine</p>
<p>using sudo is by just adding the word sudo in front of any command that requires root/superuser privileges</p>
<p><span style="color:#ffffff;">.</span></p>
<p>3) <strong>wc </strong>= wc displays a count of lines, words,  and  characters  in  a               file</p>
<p>Examples:</p>
<p><strong>wc resignationletter.txt </strong></p>
<p>output is : 10   52   121  resignationletter.txt</p>
<p>10 = lines,  52 = words, 121 = characters</p>
<p><strong>wc -w </strong><strong>resignationletter.txt </strong></p>
<p>the command above is to get only the word count</p>
<p><strong>wc -c</strong> <strong>filename </strong>: to get the character count</p>
<p><strong>wc -l</strong> <strong>filename </strong>: to get the number of lines in the document</p>
<p><span style="color:#ffffff;">.</span></p>
<p>4) <strong>cut </strong>= <span>takes a vertical slice of a file, printing only the specified columns or fields</span></p>
<p>Eg 1 : For Findind List of users available on your linux machine<br />
( see the previous post)</p>
<p><strong>cut -d : -f 1 /etc/passwd</strong></p>
<p>/etc/passwd is the file about user information , the general format of this file is</p>
<p>username:password:userid:groupid:userdirectory:usershell<br />
or<br />
antony:x:103:105:/home/antony:/bin/sh</p>
<p>x means password is in /etc/shadow field</p>
<p>now i want ot retrieve the all username and their userid from that file<br />
the command is<br />
<strong><br />
cut -d : -f 1 3 /etc/passwd</strong></p>
<p>cut  &#8211; command name<br />
-d   &#8211;  delimiter (:)<br />
-f   &#8211;  field numbers seperated by space (1 -username , 3 &#8211; userid)</p>
<p>Eg 2: the same like we can retrieve the groups details from /etc/groups</p>
<p><strong>cut -d : -f 1 /etc/groups </strong></p>
<p><em>taken from http://linuxforadmin.blogspot.com/2007/08/cut-command.html</em></p>
<p><span style="color:#ffffff;">.</span></p>
<p>5) <strong>diff </strong>= displays two files and prints             the lines that are different</p>
<p>Examples:</p>
<p>diff filenew.txt fileold.txt : use to compare the different between the two files.</p>
<p><em>more examples at http://lowfatlinux.com/linux-compare-files-diff.html</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linuxfrombeginning.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linuxfrombeginning.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linuxfrombeginning.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linuxfrombeginning.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linuxfrombeginning.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linuxfrombeginning.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linuxfrombeginning.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linuxfrombeginning.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linuxfrombeginning.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linuxfrombeginning.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linuxfrombeginning.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linuxfrombeginning.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linuxfrombeginning.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linuxfrombeginning.wordpress.com/172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=172&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linuxfrombeginning.wordpress.com/2008/09/26/linux-command-10-su-su-sudo-wc-cut-diff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40aa09b66c9a8cfa43bb39ef2a9d7d60?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxlibrary</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Command 9 &#8211; chown, chgrp, chmod, umask</title>
		<link>http://linuxfrombeginning.wordpress.com/2008/09/25/linux-command-9-chown-chgrp-chmod/</link>
		<comments>http://linuxfrombeginning.wordpress.com/2008/09/25/linux-command-9-chown-chgrp-chmod/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 22:58:10 +0000</pubDate>
		<dc:creator>linuxlibrary</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[chgrp]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[chown]]></category>
		<category><![CDATA[linux command]]></category>
		<category><![CDATA[umask]]></category>

		<guid isPermaLink="false">http://linuxfrombeginning.wordpress.com/?p=160</guid>
		<description><![CDATA[1) chown :  change file owner and group To check the ownership of a file or directory use ls -l Usage: chown [-Rcfv] newowner filenames/directory. Take note only root can change the ownership. Example: chown linda file.txt This will cause file.txt to now be owned by linda. chown -R abu:sales /home/account/ This is going to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=160&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1) <strong>chown </strong>:  change file owner and group</p>
<p>To check the ownership of a file or directory use ls -l</p>
<p>Usage: chown [-Rcfv] newowner filenames/directory. Take note only root can change the ownership.</p>
<p>Example:</p>
<p><strong>chown linda file.txt</strong></p>
<p>This will cause file.txt to now be owned by linda.</p>
<p><strong>chown -R abu:sales /home/account/ </strong></p>
<p>This is going to make all files inside /home/account/ and its subdirectories to belong to abu and to be associated with the group sales. -R means include all subdirectories</p>
<p><span style="color:#ffffff;">.</span></p>
<p>2) <strong>chgrp </strong>: change group ownership <a name="lbAC"><br />
</a></p>
<p>Usage : chgrp [-Rcfv] groupname foo.txt</p>
<p>Example:</p>
<p><strong>chgrp marketing file.txt -</strong> to change the group specified to a certain document<strong><br />
</strong></p>
<p><strong>chgrp oracle /usr/database &#8211; </strong>to change the group specified to a certain directory</p>
<p><strong>chgrp -R marketing /sales/2008 &#8211; </strong>to change the group specified to a certain directory recursively</p>
<p><span style="color:#ffffff;">.</span></p>
<p>3) <strong>chmod </strong>: to change the permissions of a file or directory. Use ls -l to see the permission settings.</p>
<p>Below is how the permission is assigned.</p>
<p><a href="http://linuxfrombeginning.files.wordpress.com/2008/09/permissions_diagram.gif"><img class="aligncenter size-medium wp-image-162" title="permissions_diagram" src="http://linuxfrombeginning.files.wordpress.com/2008/09/permissions_diagram.gif?w=300&#038;h=196" alt="" width="300" height="196" /></a></p>
<pre><tt><tt>rwx rwx rwx = 111 111 111
rw- rw- rw- = 110 110 110
rwx --- --- = 111 000 000

and so on...

rwx = 111 in binary = 7
rw- = 110 in binary = 6
r-x = 101 in binary = 5
r-- = 100 in binary = 4
</tt></tt></pre>
<p>For example, if we wanted to set <tt>some_file</tt> to have read and write permission for the owner, but wanted to keep the file private from others, we would:</p>
<p><strong><tt class="cmd">chmod 600 some_file</tt></strong></p>
<p>Here is a table of numbers that covers all the common settings. The ones beginning with &#8220;7&#8243; are used with programs (since they enable execution) and the rest are for other kinds of files.</p>
<table border="1" cellpadding="8">
<tbody>
<tr>
<td><em>Value</em></td>
<td><em>Meaning</em></td>
</tr>
<tr>
<td><em>777</em></td>
<td><em>(rwxrwxrwx)</em> No restrictions on 		permissions. Anybody may do anything. 		Generally not a desirable setting.</td>
</tr>
<tr>
<td><em>755</em></td>
<td><em>(rwxr-xr-x)</em> The file&#8217;s owner may 		read, write, and execute the file. All others 		may read and execute the file. This setting 		is common for programs that are used by all 		users.</td>
</tr>
<tr>
<td><em>700</em></td>
<td><em>(rwx&#8212;&#8212;)</em> The file&#8217;s owner may 		read, write, and execute the file. Nobody 		else has any rights. This setting is useful 		for programs that only the owner may use and 		must be kept private from others.</td>
</tr>
<tr>
<td><em>666</em></td>
<td><em>(rw-rw-rw-)</em> All users may read 		and write the file.</td>
</tr>
<tr>
<td><em>644</em></td>
<td><em>(rw-r&#8211;r&#8211;)</em> The owner may read 		and write a file, while all others may only 		read the file. A common setting for data 		files that everybody may read, but only the 		owner may change.</td>
</tr>
<tr>
<td><em>600</em></td>
<td><em>(rw&#8212;&#8212;-)</em> The owner may read 		and write a file. All others have no rights. 		A common setting for data files that the 		owner wants to keep private.</td>
</tr>
</tbody>
</table>
<h2><a name="directory_permissions"></a></h2>
<p>Here are some useful settings for directories:</p>
<table border="1" cellpadding="8">
<tbody>
<tr>
<td><em>Value</em></td>
<td><em>Meaning</em></td>
</tr>
<tr>
<td><em>777</em></td>
<td><em>(rwxrwxrwx)</em> No restrictions on 		permissions. Anybody may list files, create 		new files in the directory and delete files 		in the directory. Generally not a good 		setting.</td>
</tr>
<tr>
<td><em>755</em></td>
<td><em>(rwxr-xr-x)</em> The directory owner 		has full access. All others may list the 		directory, but cannot create files nor delete 		them. This setting is common for directories 		that you wish to share with other users.</td>
</tr>
<tr>
<td><em>700</em></td>
<td><em>(rwx&#8212;&#8212;)</em> The directory owner 		has full access. Nobody else has any rights. 		This setting is useful for directories that 		only the owner may use and must be kept 		private from others.</td>
</tr>
</tbody>
</table>
<h2><a name="su"></a></h2>
<p><em>taken from http://www.linuxcommand.org/lts0070.php</em></p>
<p><span style="text-decoration:underline;"><strong>chmod Shortcuts</strong></span></p>
<p><strong>Who</strong></p>
<p>The “who” is a list of letters that specifies whom you’re going to be giving permissions to. These may be specified in any order.</p>
<table border="1">
<tbody>
<tr>
<td align="center"><code> u </code></td>
<td>The <strong>u</strong>ser who owns the file (this means “you.”)</td>
</tr>
<tr>
<td align="center"><code> g </code></td>
<td>The <strong>g</strong>roup the file belongs to.</td>
</tr>
<tr>
<td align="center"><code> o </code></td>
<td>The <strong>o</strong>ther users</td>
</tr>
<tr>
<td align="center"><code> a </code></td>
<td><strong>a</strong>ll of the above (an abbreviation for <code>ugo</code>)</td>
</tr>
</tbody>
</table>
<p><span style="color:#ffffff;">.</span></p>
<p><strong>Permissions</strong></p>
<p>Of course, the permissions are the same letters that you see in the directory listing:</p>
<table border="1">
<tbody>
<tr>
<td align="center"><code> r </code></td>
<td>Permission to <strong>r</strong>ead the file.</td>
</tr>
<tr>
<td align="center"><code> w </code></td>
<td>Permission to <strong>w</strong>rite (or delete) the file.</td>
</tr>
<tr>
<td align="center"><code> x </code></td>
<td>Permission to e<strong>x</strong>ecute the file, or, in  	the case of a directory, search it.</td>
</tr>
</tbody>
</table>
<p>Let’s say we have these files:</p>
<pre>-rwxrwxrwx  joe  acctg  wordmatic
-r--r--r--  joe  acctg  calcmatic</pre>
<p>We’d like to remove write permission for the <strong>g</strong>roup and <strong>o</strong>thers on <code>wordmatic</code>, and add write and execute permission for <strong>a</strong>ll users on <code>calcmatic</code>.</p>
<p>Rather than try to figure out what the new permissions are and do these commands:</p>
<pre>   chmod go=rx wordmatic
   chmod a=rwx calcmatic</pre>
<p>The <code>chmod</code> command literally lets us add and subtract permissions from an existing set by using <code>+</code> or <code>-</code> instead of <code>=</code>.</p>
<p>Thus, we can take away the first file’s write permission for the <strong>g</strong>roup and <strong>o</strong>thers with this command:</p>
<pre>   chmod go-w wordmatic</pre>
<p>&#8230;and we can add write and execute permission to the second file for <strong>a</strong>ll users with:</p>
<pre>   chmod a+wx calcmatic</pre>
<p><strong>Copying Permissions</strong></p>
<p>As one other shortcut, it’s possible to tell <code>chmod</code> “give users of one class the same permissions that some other class has.”</p>
<p>Let’s say we have these files:</p>
<pre>d------rwx  joe  acctg  sales
-rw-r--r--  joe  acctg  info.dat</pre>
<p>The <strong>o</strong>ther users have full permissions on the <code>sales</code> directory. We’d like to say “ the <strong>u</strong>ser and <strong>g</strong>roup should be assigned (=) the permissions belonging to <strong>o</strong>thers.” That translates to:</p>
<pre>   chmod ug=o</pre>
<p>Similarly, to make <code>info.dat</code> readable and writable to the <strong>g</strong>roup, we can say:</p>
<pre>   chmod g=u info.dat</pre>
<p>(you can read this as “the <strong>g</strong>roup is assigned (=) the permissions currently held by the <strong>u</strong>ser.”)</p>
<p>You may also use + and &#8211; to add and subtract the permissions that currently belong to a different class of user.</p>
<p>You can’t mix the standard permissions (<code>r</code>, <code>w</code>, and <code>x</code>) with the coyping shortcuts. <code>chmod</code> will protest if you give it something like this:</p>
<pre>   chmod g=wu info.dat</pre>
<p><em>Taken from http://catcode.com/teachmod/chmod_cmd.html</em></p>
<p><span style="color:#ffffff;">.</span></p>
<p>4) <strong>umask </strong>= set file creation mask</p>
<p>The &#8216;<strong>UMASK</strong>&#8216; is the <em>default permission setting</em> that is           applied to your files and directories when they are created. After files           and directories are created, the <strong>chmod</strong> command can be used to           <em>change the permissions</em> to allow or disallow access as before.           The UMASK is set when you login to a UNIX machine.</p>
<p>It is, however, possible to change your UMASK and put the UMASK in           your login files so that your default permissions are always set for           files when you create them.</p>
<p>Just like chmod, a umask works on a number. However, instead of the           numbers being ADDED like chmod, with a umask the numbers are SUBTRACTED           from 7.</p>
<p>So from chmod -</p>
<p>Read &#8211; 4<br />
Write &#8211; 2<br />
Execute &#8211; 1</p>
<p>If a user wants all directories to be created with rwxr-xr-x, that           is</p>
<p>Owner == Read, Write, Execute == 7 &#8211; 4 &#8211; 2 &#8211; 1 == 0<br />
Group == Read, Execute == 7 &#8211; 4 &#8211; 1 == 2<br />
Others == Read, Execute == 7 &#8211; 4 &#8211; 1 == 2</p>
<p><strong>Then the umask would be 022</strong></p>
<p>There is one important difference with the UMASK and files and directories           &#8211; the execute part will be set on directories, but they have to be manually           changed on files after the file has been created. The read and write           parts remain the same.</p>
<p>You can change your default UMASK using the command &#8216;umask&#8217;. For example,           the command:</p>
<p>umask 022</p>
<p>Will change your umask to the permissions stated above.</p>
<p>To make your new umask be the default for your next login, you will           have to edit your .login file and place the umask command down the bottom           of that file. The next time you login to your UNIX system, your default           umask will be set to that which you have specified in your .login file.</p>
<p>For redhat, to change permanently modify .bashrc and include <strong>umask nnn</strong> in one of the lines.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linuxfrombeginning.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linuxfrombeginning.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linuxfrombeginning.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linuxfrombeginning.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linuxfrombeginning.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linuxfrombeginning.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linuxfrombeginning.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linuxfrombeginning.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linuxfrombeginning.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linuxfrombeginning.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linuxfrombeginning.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linuxfrombeginning.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linuxfrombeginning.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linuxfrombeginning.wordpress.com/160/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=160&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linuxfrombeginning.wordpress.com/2008/09/25/linux-command-9-chown-chgrp-chmod/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40aa09b66c9a8cfa43bb39ef2a9d7d60?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxlibrary</media:title>
		</media:content>

		<media:content url="http://linuxfrombeginning.files.wordpress.com/2008/09/permissions_diagram.gif?w=300" medium="image">
			<media:title type="html">permissions_diagram</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Command 8 &#8211; find, locate, whereis, sort, grep</title>
		<link>http://linuxfrombeginning.wordpress.com/2008/09/20/linux-command-8-find-locate-whereis-sort-grep/</link>
		<comments>http://linuxfrombeginning.wordpress.com/2008/09/20/linux-command-8-find-locate-whereis-sort-grep/#comments</comments>
		<pubDate>Sun, 21 Sep 2008 06:16:36 +0000</pubDate>
		<dc:creator>linuxlibrary</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[linux command]]></category>
		<category><![CDATA[locate]]></category>
		<category><![CDATA[sort]]></category>
		<category><![CDATA[whereis]]></category>

		<guid isPermaLink="false">http://linuxfrombeginning.wordpress.com/?p=139</guid>
		<description><![CDATA[1) find = finds one or more files assuming that you know their approximate filenames Examples: find -name mypage.htm In the above command the system would search for any file named mypage.htm in the current directory and any subdirectory. find / -name mypage.htm In the above example the system would search for any file named [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=139&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1) <strong>find </strong>= finds one or more files assuming             that you know their approximate filenames</p>
<p>Examples:</p>
<p><strong>find -name mypage.htm</strong><br />
In the above command the system would search for any file named mypage.htm in the current directory and any subdirectory.</p>
<p><strong>find / -name mypage.htm</strong><br />
In the above example the system would search for any file named mypage.htm on the root and all subdirectories from the root.</p>
<p><strong>find -name file*</strong><br />
In the above example the system would search for any file beginning with file in the current directory and any subdirectory.</p>
<p><strong>find -name &#8216;*&#8217; -size +1000k</strong><br />
In the above example the system would search for any file that is larger then 1000k.</p>
<p><strong>find /usr -name *stat</strong></p>
<p>Find every file under the directory /usr ending in &#8220;.stat&#8221;.</p>
<p><strong>find / -mtime -2 -print</strong></p>
<p>Search the system for files that were modified within the last two days (good candidates for backing up)</p>
<p>More examples: http://www.oracle.com/technology/pub/articles/calish-find.html</p>
<p><span style="color:#ffffff;">.</span></p>
<p>2) <strong>locate </strong>= find files by name</p>
<p><strong><em></em></strong></p>
<p>Searches are conducted against a database of system contents that is updated periodically. To update the database, use the <strong>updatedb</strong> command.</p>
<p><strong><code>locate "*.png" </code></strong></p>
<p><strong><code> </code></strong><span style="color:#000000;">to display all files on the system that have the <em>.png</em> filename extension</span></p>
<p><strong><code>locate "*.png" -q</code></strong></p>
<p>to suppress error messages, such as those that might be returned in the event that the user does not have permission to access designated files or directories</p>
<p><strong><code>locate  -n 15 "*.html"</code></strong></p>
<p>display only 15 results in a search for files that have an <em>.html</em> extension:</p>
<p><strong><code>locate  "*.html" | less</code></strong></p>
<p>presents only one screenful of output at a time</p>
<p><strong><code>locate -i "*.HtmL"</code></strong></p>
<p>The<strong> -i</strong> option performs a case-insensitive search. That is, it will return any results that match the arguments regardless of whether individual letters are lower case or upper case.</p>
<p><span style="color:#ffffff;">.</span></p>
<p>3) <strong>whereis </strong>= the whereis command is used to locate the binary, the source code and the online manual page for any specified program. Take note it is not for searching your files.</p>
<p>Example:</p>
<p><strong>whereis locate</strong></p>
<p>locate: /usr/bin/locate /usr/share/man/man1/locate.1.gz</p>
<p><strong>whereis -b locate</strong> (search only binaries)</p>
<p>locate: /usr/bin/locate</p>
<p><span style="color:#ffffff;">.</span></p>
<p>4) <strong>sort </strong>=  sort lines of text files</p>
<p>sort can be used in many ways, below are some simple examples</p>
<p>a) example 1</p>
<p>assume i have 1 text file with name fruits containing below</p>
<p>orange<br />
lemon</p>
<p>and another text file veggy with contents below</p>
<p>papaya<br />
cucumber</p>
<p><strong>sort fruits veggy</strong> : it will produce output in alphabetical order as below</p>
<p>cucumber<br />
lemon<br />
orange<br />
papaya</p>
<p><strong>sort fruits veggy &gt; fruitveggy : </strong>this command will save into a file fruitveggy</p>
<p>b) example 2</p>
<p>i can create a text file that is sorted in real time, for example, by typing</p>
<p><strong>sort &gt; color </strong></p>
<p>it will put me into data entry mode, i can keep entering data for example blue, green, yellow each followed by &lt;enter&gt; command. once im done, pressing<strong> Ctrl-D </strong>keep me back at command prompt. now if i check the text file color i can see alll my input is there already sort out</p>
<p>c) example 3</p>
<p>i have a data file data.txt as below:</p>
<p>24 John<br />
45 Sharon<br />
98 Robert</p>
<p>i want to sort it on second field (name by alphabetical order), i can use this command</p>
<p><strong><code>sort -d -k 2 data.txt</code></strong> , the output will be</p>
<p>24 John<br />
98 Robert<br />
45 Sharon</p>
<p>Explanation: The &#8216;-d&#8217; switch stands for &#8216;dictionary sort&#8217; and ensures that sorting</p>
<p>takes place alphabetically as a dictionary would do it. The &#8216;-k&#8217; switch</p>
<p>stands for &#8216;key&#8217; and with the &#8217;2&#8242; tells sort to sort on the second</p>
<p>field in the file, that is the names.</p>
<p><span style="color:#ffffff;">.</span></p>
<p>5) <strong>grep</strong> = finds text within a file</p>
<p><strong>grep tutorial *.htm = </strong>search all .htm               files in the current directory for the text &#8220;tutorial&#8221;</p>
<p><strong>grep -i love history.txt</strong> =<span><span style="font-family:Courier;"><strong> </strong></span></span><span>print all lines containing love (ignoring uppercase and lowercase) in history.txt</span></p>
<p><strong>grep -ic &#8220;love me&#8221; history.txt</strong> = <span>To print just the number of lines containing the word &#8220;love me&#8221;<br />
</span></p>
<p><strong>grep -r tutorial *</strong> = -r is to search not only in the current directory but recursively in all the sub directories, the symbol * means to search all files</p>
<p><strong>ls | grep readme</strong> = this command is to print all files that has the phrase &#8220;readme&#8221; in the filename. take note it is not the text inside the document but the name of the document</p>
<p><strong>ls -l | grep rwxrwxrwx</strong><code> = </code>to find all filesystem objects in the current directory whose permissions have been set so that any user can read, write and execute them</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linuxfrombeginning.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linuxfrombeginning.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linuxfrombeginning.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linuxfrombeginning.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linuxfrombeginning.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linuxfrombeginning.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linuxfrombeginning.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linuxfrombeginning.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linuxfrombeginning.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linuxfrombeginning.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linuxfrombeginning.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linuxfrombeginning.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linuxfrombeginning.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linuxfrombeginning.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=139&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linuxfrombeginning.wordpress.com/2008/09/20/linux-command-8-find-locate-whereis-sort-grep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40aa09b66c9a8cfa43bb39ef2a9d7d60?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxlibrary</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Filesystems &#8211; Filesystem hierachy standard</title>
		<link>http://linuxfrombeginning.wordpress.com/2008/09/20/linux-filesystems-filesystem-hierachy-standard/</link>
		<comments>http://linuxfrombeginning.wordpress.com/2008/09/20/linux-filesystems-filesystem-hierachy-standard/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 12:46:57 +0000</pubDate>
		<dc:creator>linuxlibrary</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fhs]]></category>
		<category><![CDATA[filesystem hierarchy]]></category>
		<category><![CDATA[linux filesystem]]></category>

		<guid isPermaLink="false">http://linuxfrombeginning.wordpress.com/?p=130</guid>
		<description><![CDATA[. The /bin/ Directory The /bin is a standard subdirectory of the root directory in  that contains the executable (i.e., ready to run) programs that must be available in order to attain minimal functionality for the purposes of booting (i.e., starting) and repairing a system. . The /boot/ Directory The /boot/ directory contains static files [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=130&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><a href="http://linuxfrombeginning.files.wordpress.com/2008/09/dirtree.jpg"><img class="aligncenter size-medium wp-image-131" title="dirtree" src="http://linuxfrombeginning.files.wordpress.com/2008/09/dirtree.jpg?w=500&#038;h=450" alt="" width="500" height="450" /></a></p>
<p style="text-align:center;"><span style="color:#ffffff;">.</span></p>
<p><span style="text-decoration:underline;"><strong>The /bin/ Directory</strong></span></p>
<p>The /bin is a standard subdirectory of the root directory in  that contains the executable (i.e., ready to run) programs that must be available in order to attain minimal functionality for the purposes of booting (i.e., starting) and repairing a system.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><span style="text-decoration:underline;"><strong>The /boot/ Directory</strong></span></p>
<p style="text-align:left;">The <tt class="filename">/boot/</tt> directory contains static files required to boot the system, such as the Linux kernel. These files are essential for the system to boot properly.</p>
<p style="text-align:left;"><span style="color:#ffffff;">.</span></p>
<p class="title"><strong><span style="text-decoration:underline;">The /dev/ Directory</span></strong></p>
<p style="text-align:left;">The <tt class="filename">/dev/</tt> directory contains device nodes that either represent devices that are attached to the system or virtual devices that are provided by the kernel. These device nodes are essential for the system to function properly. The <tt class="command">udev</tt> demon takes care of creating and removing all these device nodes in <tt class="filename">/dev/</tt>.</p>
<p>Examples of common files in the /dev include:</p>
<pre class="screen"><tt class="filename">/dev/hda</tt> - the master device on primary IDE channel.
<tt class="filename">/dev/hdb</tt> - the slave device on primary IDE channel.
<tt class="filename">/dev/tty0</tt> - first virtual console.
<tt class="filename">/dev/tty1</tt> - second virtual console.
<tt class="filename">/dev/sda</tt> - first device on primary SCSI or SATA channel.
<tt class="filename">/dev/lp0</tt> - first parallel port.

<span style="color:#ffffff;">.</span></pre>
<p><strong><span style="text-decoration:underline;">The /etc/ Directory</span></strong></p>
<p>The <tt class="filename">/etc/</tt> directory is reserved for configuration files that are local to the machine. No binaries are to be placed in <tt class="filename">/etc/</tt>. Any binaries that were once located in <tt class="filename">/etc/</tt> should be placed into <tt class="filename">/sbin/</tt> or <tt class="filename">/bin/</tt>.</p>
<p>/etc/opt/ &#8211; Configuration files for /opt/.</p>
<p>/etc/X11/ &#8211; Configuration files for the X Window System, version 11.</p>
<p>/etc/sgml/ &#8211; Configuration files for SGML.</p>
<p>/etc/xml/ &#8211; Configuration files for XML.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><strong><span style="text-decoration:underline;">The /lib/ Directory</span></strong></p>
<p>The <tt class="filename">/lib/</tt> directory should contain only those libraries needed to execute the binaries in <tt class="filename">/bin/</tt> and <tt class="filename">/sbin/</tt>. These shared library images are 					particularly important for booting the system and executing commands within the root file system.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><strong><span style="text-decoration:underline;">The /media/ Directory</span></strong></p>
<p>The <tt class="filename">/media/</tt> directory contains subdirectories used as mount points for removeable media such as usb storage media, DVDs, CD-ROMs, and Zip disks.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><strong><span style="text-decoration:underline;">The /mnt/ Directory</span></strong></p>
<p>The <tt class="filename">/mnt/</tt> directory is reserved for temporarily mounted file systems, such as NFS file system mounts. For all removeable media, please use the <tt class="filename">/media/</tt> directory. Automatically detected removeable media will be mounted in the  <tt class="filename">/media</tt> directory.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><strong><span style="text-decoration:underline;">The /opt/ Directory</span></strong></p>
<p>A package placing files in the <tt class="filename">/opt/</tt> directory creates a directory bearing the same name as the package. This directory, in turn, holds files that otherwise would be scattered throughout the file system, giving the system administrator an easy way to determine the role of each file within a particular package.</p>
<p>For example, if <tt class="filename">sample</tt> is the name of a particular software package located within the <tt class="filename">/opt/</tt> directory, then all of its files are placed in directories inside the <tt class="filename">/opt/sample/</tt> directory, such as <tt class="filename">/opt/sample/bin/</tt> for binaries and <tt class="filename">/opt/sample/man/</tt> for manual pages.</p>
<p>Packages that encompass many different sub-packages, data files, extra fonts, clipart etc are also located in the <tt class="filename">/opt/</tt> directory, giving that large package a way to organize itself. In this way, our <tt class="filename">sample</tt> package may have different tools that each go in their own sub-directories, such as <tt class="filename">/opt/sample/tool1/</tt> and <tt class="filename">/opt/sample/tool2/</tt>, each of which can have their own <tt class="filename">bin/</tt>, <tt class="filename">man/</tt>, and other similar directories.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><strong><span style="text-decoration:underline;">The /proc/ Directory</span></strong></p>
<p>The <tt class="filename">/proc/</tt> directory contains special files that either extract information from or send information to the kernel. Examples include system memory, cpu information, hardware configuration etc</p>
<p><span style="color:#ffffff;">.</span></p>
<p><strong><span style="text-decoration:underline;">The /sbin/ Directory</span></strong></p>
<p>The <tt class="filename">/sbin/</tt> directory stores executables used by the root user. The executables in <tt class="filename">/sbin/</tt> are used at boot time, for system administration and to perform system recovery operations.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><strong><span style="text-decoration:underline;">The /srv/ Directory</span></strong></p>
<p>The <tt class="filename">/srv/</tt> directory contains site-specific data served by your system running Red Hat Enterprise Linux. This directory gives users the location of data files for a particular service, such as FTP, WWW, or CVS. Data that only pertains to a specific user should go in the <tt class="filename">/home/</tt> directory.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><strong><span style="text-decoration:underline;">The /sys/ Directory</span></strong></p>
<p>The <tt class="filename">/sys/</tt> directory utilizes the new <tt class="filename">sysfs</tt> virtual file system specific to the 2.6 kernel. With the increased support for hot plug hardware devices in the 2.6 kernel, the <tt class="filename">/sys/</tt> directory contains information similarly held in <tt class="filename">/proc/</tt>, but displays a hierarchical view of specific device information in regards to hot plug devices.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><strong><span style="text-decoration:underline;">The /usr/ Directory</span></strong></p>
<p>The <tt class="filename">/usr/</tt> directory is for files that can be shared across multiple machines. The <tt class="filename">/usr/</tt> directory is often on its own partition and is mounted read-only. At a minimum, the following directories should be subdirectories of <tt class="filename">/usr/</tt>:</p>
<pre class="screen"><tt class="computeroutput">/usr
   |- bin/
   |- etc/
   |- games/
   |- include/
   |- kerberos/
   |- lib/
   |- libexec/
   |- local/
   |- sbin/
   |- share/
   |- src/
   |- tmp -&gt; ../var/tmp/</tt></pre>
<p>Under the <tt class="filename">/usr/</tt> directory, the <tt class="filename">bin/</tt> subdirectory contains executables, <tt class="filename">etc/</tt> contains system-wide configuration files, <tt class="filename">games</tt> is for games, <tt class="filename">include/</tt> contains C header files, <tt class="filename">kerberos/</tt> contains binaries and other Kerberos-related files, and <tt class="filename">lib/</tt> contains object files and libraries that are not designed to be directly utilized by users or shell scripts. The <tt class="filename">libexec/</tt> directory contains small helper programs called by other programs, <tt class="filename">sbin/</tt> is for system administration binaries (those that do not belong in the <tt class="filename">/sbin/</tt> directory), <tt class="filename">share/</tt> contains files that are not architecture-specific, <tt class="filename">src/</tt> is for source code.</p>
<p><span style="text-decoration:underline;">The /usr/local Directory</span></p>
<p>The <tt class="filename">/usr/local</tt> hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. It may be used for programs and data that are shareable among a group of hosts, but not found in <tt class="filename">/usr</tt>.</p>
<p>The <tt class="filename">/usr/local/</tt> directory is similar in structure to the <tt class="filename">/usr/</tt> directory. It has the following subdirectories, which are similar in purpose to those in the	<tt class="filename">/usr/</tt> directory:</p>
<pre class="screen"><tt class="computeroutput">
/usr/local
        |- bin/
	|- etc/
	|- games/
	|- include/
	|- lib/
	|- libexec/
	|- sbin/
	|- share/
	|- src/</tt>

<span style="color:#ffffff;">.</span></pre>
<p><strong><span style="text-decoration:underline;">The /var/ Directory</span></strong></p>
<p>Since the FHS requires Linux to mount <tt class="filename">/usr/</tt> as read-only, any programs that write log files or need <tt class="filename">spool/</tt> or <tt class="filename">lock/</tt> directories should write them to the <tt class="filename">/var/</tt> directory. The FHS states <tt class="filename">/var/</tt> is for:</p>
<div class="blockquote">
<blockquote class="blockquote"><p>&#8230;variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files.</p></blockquote>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linuxfrombeginning.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linuxfrombeginning.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linuxfrombeginning.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linuxfrombeginning.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linuxfrombeginning.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linuxfrombeginning.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linuxfrombeginning.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linuxfrombeginning.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linuxfrombeginning.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linuxfrombeginning.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linuxfrombeginning.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linuxfrombeginning.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linuxfrombeginning.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linuxfrombeginning.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=130&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linuxfrombeginning.wordpress.com/2008/09/20/linux-filesystems-filesystem-hierachy-standard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40aa09b66c9a8cfa43bb39ef2a9d7d60?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxlibrary</media:title>
		</media:content>

		<media:content url="http://linuxfrombeginning.files.wordpress.com/2008/09/dirtree.jpg?w=300" medium="image">
			<media:title type="html">dirtree</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Filesystems &#8211; type of filesysystems</title>
		<link>http://linuxfrombeginning.wordpress.com/2008/09/20/linux-filesystems-type-of-filesysystems/</link>
		<comments>http://linuxfrombeginning.wordpress.com/2008/09/20/linux-filesystems-type-of-filesysystems/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 11:06:42 +0000</pubDate>
		<dc:creator>linuxlibrary</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ext]]></category>
		<category><![CDATA[ext2]]></category>
		<category><![CDATA[ext3]]></category>
		<category><![CDATA[filesystems type]]></category>
		<category><![CDATA[jfs]]></category>
		<category><![CDATA[linux filesystems]]></category>
		<category><![CDATA[minix]]></category>
		<category><![CDATA[reiserfs]]></category>
		<category><![CDATA[xfs]]></category>

		<guid isPermaLink="false">http://linuxfrombeginning.wordpress.com/?p=124</guid>
		<description><![CDATA[Each type of filesystem has its own set of rules for controlling the allocation of disk space to files and for associating data about each file (referred to as metadata) with that file, such as its name, the directory in which it is located, its access permissions and its creation date. . Minix filesystem 1) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=124&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Each type of filesystem has its own set of rules for controlling the allocation of disk space to files and for associating data about each file (referred to as <em>metadata</em>) with that file, such as its name, the directory in which it is located, its access permissions and its creation date.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><span style="text-decoration:underline;"><strong>Minix filesystem</strong></span></p>
<p>1) The earliest versions of Linux used the Minix filesystem, which was developed by Professor Andrew S. Tanenbaum for use in his MINIX operating system, a small clone of UNIX  that was intended only for computer science education purposes.</p>
<p>2) Although mostly free of bugs, it suffered from a small maximum partition size of 64 megabytes and a file name length limit of 14 characters.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><span style="text-decoration:underline;"><strong>The extended file system, also called Ext</strong></span></p>
<p>1) Was released in April 1992 and was included in the Linux <em>kernel</em> (i.e, core of the operating system) version 0.96c.</p>
<p>2) It overcame the main Minix limitations by allowing a huge increase in maximum partition size to two gigabytes and file names of up to 255 characters</p>
<p>3) However, ext still had problems: in particular, it lacked support for separate access for each user and group, and it also lacked timestamps for modifications to <em>inodes</em> and to data. An inode is a data structure on a filesystem on Unix-like operating systems that stores all of a file&#8217;s metadata except its name.</p>
<p>4) Another problem was that the <em>linked lists</em> data structure ext used to track free blocks and inodes gradually became unsorted as the filesystem was used, thus causing the filesystem to become <em>fragmented</em> (i.e., parts of files widely dispersed rather than in contiguous blocks).</p>
<p><span style="color:#ffffff;">.</span></p>
<p><span style="text-decoration:underline;"><strong>Ext2 filesystems</strong></span></p>
<p>1) Ext2 was initially designed by Rémy Card, a French software developer, based on ext but incorporating many ideas from the <em>Berkeley Fast File System</em> and with extensibility in mind.</p>
<p>2) Ext2 features (1) improved algorithms that greatly increase its speed, (2) additional timestamps (such as date of last access and date of last inode modification), (3) the ability to track the state of the filesystem and (4) support for a maximum file size of 4TB (one terabyte equals 1024 gigabytes).</p>
<p>3) It maintains a special field in the <em>superblock</em> that indicates the status of the filesystem as either <em>clean</em> or <em>dirty; </em> the latter will trigger a utility to scan the filesystem for errors. As a result of these improvements, ext2 has completely superseded ext.</p>
<p>4) Ext2 is designed so that data is held in blocks of equal size on the HDD or other storage medium, although blocks can be different sizes on different partitions, different HDDs, etc. The size is set when the filesystem is created by the <em>mke2fs</em> program. The disadvantage of this approach is that an average of half of the block size is wasted for each file. For example, with a a block size of 1024 bytes, each 1025 byte file would require two blocks.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><span style="text-decoration:underline;"><strong>Ext3 filesystems</strong></span></p>
<p>1) Ext3 has been integrated into the Linux kernel since version 2.4.16 and has become the default filesystem on Red Hat and some other distributions. It is basically an extension of ext2 to which a journaling capability has been added, and it provides the same high degree of reliability because of the exhaustively field-proven nature of its underlying ext2.</p>
<p>2) Also featured is the ability for ext2 partitions to be converted to ext3 and vice-versa without any need for backing up the data and repartitioning. If necessary, an ext3 partition can even be mounted by an older kernel that has no ext3 support; this is because it would be seen as just another normal ext2 partition and the journal would be ignored.</p>
<p>The ext3 file system adds, over its predecessor:</p>
<ul>
<li>A Journaling file system</li>
<li>Online file system growth</li>
<li><span class="new">htree</span> indexing for larger directories (specialized version of a B-tree — not to be confused with H tree)</li>
</ul>
<p><span style="color:#ffffff;">.</span></p>
<p><span style="text-decoration:underline;"><strong>ReiserFS</strong></span></p>
<p>1) ReiserFS, developed by Hans Reiser and others, was actually the first journaling filesystem added to the Linux kernel. As was the case with ext2, it was designed from the ground up for use in Linux.</p>
<p>2) However, unlike ext3, it was also designed from the ground up as a journaling filesystem rather than as an add-on to an existing filesystem, and thus it is widely considered to be the most advanced of the native Linux journaling filesystems.</p>
<p>3) Features include high speed, excellent stability and the ability to pack small files into less disk space than is possible with many other filesystems.</p>
<p>4) A new version of ReiserFS, designated Reiser4, was scheduled for release in the first half of 2004. It is a complete rewrite from version 3 and is said to result in major improvements in performance, including higher speeds, the ability to accommodate more CPUs, built-in encryption and ease of customization.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><span style="text-decoration:underline;"><strong>JFS</strong></span></p>
<p>1) JFS was originally developed by IBM in the mid-1990s for its AIX Unix operating system, and it was later ported to the company&#8217;s OS/2 operating system. IBM subsequently changed the licensing of the OS/2 implementation to open source, which led to its support on Linux.</p>
<p>2) JFS is currently used primarily on IBM enterprise servers, and it is also a good choice for systems that multiboot Linux and OS/2.</p>
<p>3) JFS provides fast file system restart in the event of a system crash. Using database journaling techniques, JFS can restore a file system to a consistent state in a matter of seconds or minutes, versus hours or days with non-journaled file systems.</p>
<p><span style="color:#ffffff;">.</span></p>
<p><span style="text-decoration:underline;"><strong>XFS</strong></span></p>
<p>1) XFS was developed in the mid-1990s by Silicon Graphics (SGI) for its 64 bit IRIX Unix servers. These servers were designed with advanced graphics processing in mind, and they feature the ability to accommodate huge files sizes.</p>
<p>2) The company likewise converted XFS to open source, after which it was also adopted by Linux. Because it is a 64-bit filesystem, XFS features size limitations in the millions of terabytes (in contrast to the still generous 4TB limit of ext2).</p>
<p>The XFS filesystem provides the following major features:</p>
<ul>
<li> <strong>Quick Recovery </strong>The XFS journaling technology allows it to restart very quickly after an unexpected interruption, regardless of the number of files it is managing.  Traditional filesystems must do special filesystem checks after an interruption, which can take many hours to complete.  The XFS journaling avoids these lengthy filesystem checks.</li>
<li> <strong>Fast Transactions</strong>The XFS filesystem provides the advantages of journaling while minimizing the performance impact of journaling on read and write data transactions.  Its journaling structures and algorithms are tuned to log the transactions rapidly.
<p>XFS uses efficient tree structures for fast searches and rapid space allocation.  XFS continues to deliver rapid response times, even for directories with tens of thousands of entries.</li>
<li> <strong>Massive Scalability</strong>XFS is a full 64-bit filesystem, and thus is capable of handling filesystems as large as a million terabytes.</li>
<li> <strong>Efficient Allocations</strong>XFS implements extremely sophisticated space management techniques. Efficiency in space management has been achieved through the use of variable sized extents, rather than the simple single-block-at-a-time mechanism of many other filesystems. XFS was the first filesystem to implement delayed space allocation for buffered writes, supports direct I/O, provides an optional realtime allocator, and is able to align allocations based on the geometry of the underlying storage device. The XFS allocator performs admirably in the presence of multiple parallel writers, and is renowned for its resistance to space fragmentation under such conditions.</li>
<li> <strong>Excellent Bandwidth</strong>XFS is capable of delivering very close to the raw I/O performance that the underlying hardware can provide. XFS has proven scalability on SGI Altix systems of multiple gigabytes-per-second on multiple terabyte filesystems.</li>
</ul>
<p><span style="color:#ffffff;">.</span></p>
<p><strong><span style="text-decoration:underline;">Comparison</span></strong></p>
<table border="1" cellpadding="5" width="75%" align="center" bgcolor="#cccccc">
<tbody>
<tr>
<td align="center"><span class="boldbodycopy"><em>Feature</em></span></td>
<td align="center"><span class="boldbodycopy"><em>ext2</em></span></td>
<td align="center"><span class="boldbodycopy"><em>ext3</em></span></td>
<td align="center"><span class="boldbodycopy"><em>ReiserFS3.6 (not supported by Oracle)</em></span></td>
</tr>
<tr>
<td><span class="bodycopy">Maximum  partition size</span></td>
<td><span class="bodycopy">4TB</span></td>
<td><span class="bodycopy">4TB</span></td>
<td><span class="bodycopy">16TB</span></td>
</tr>
<tr>
<td><span class="bodycopy">Maximum file size</span></td>
<td><span class="bodycopy">2GB-2TB</span></td>
<td><span class="bodycopy">2GB-2TB</span></td>
<td><span class="bodycopy">8TB</span></td>
</tr>
<tr>
<td><span class="bodycopy">Block size</span></td>
<td><span class="bodycopy">1KB-4KB</span></td>
<td><span class="bodycopy">1KB-4KB</span></td>
<td><span class="bodycopy">4KB only</span></td>
</tr>
<tr>
<td><span class="bodycopy">Journaling capabilities</span></td>
<td><span class="bodycopy">No</span></td>
<td><span class="bodycopy">Yes</span></td>
<td><span class="bodycopy">Yes</span></td>
</tr>
<tr>
<td><span class="bodycopy">Reboot after a crash</span></td>
<td><span class="bodycopy">Slow</span></td>
<td><span class="bodycopy">Fast</span></td>
<td><span class="bodycopy">Very Fast</span></td>
</tr>
<tr>
<td><span class="bodycopy">State of  data after  crash</span></td>
<td><span class="bodycopy">Good</span></td>
<td><span class="bodycopy">Very Good</span></td>
<td><span class="bodycopy">Fair</span></td>
</tr>
<tr>
<td><span class="bodycopy">ACL support</span></td>
<td><span class="bodycopy">Yes</span></td>
<td><span class="bodycopy">Yes</span></td>
<td><span class="bodycopy">No</span></td>
</tr>
<tr>
<td><span class="bodycopy">Stability</span></td>
<td><span class="bodycopy">Excellent</span></td>
<td><span class="bodycopy">Good</span></td>
<td><span class="bodycopy">Good</span></td>
</tr>
</tbody>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linuxfrombeginning.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linuxfrombeginning.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linuxfrombeginning.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linuxfrombeginning.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linuxfrombeginning.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linuxfrombeginning.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linuxfrombeginning.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linuxfrombeginning.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linuxfrombeginning.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linuxfrombeginning.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linuxfrombeginning.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linuxfrombeginning.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linuxfrombeginning.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linuxfrombeginning.wordpress.com/124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linuxfrombeginning.wordpress.com&amp;blog=4826987&amp;post=124&amp;subd=linuxfrombeginning&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linuxfrombeginning.wordpress.com/2008/09/20/linux-filesystems-type-of-filesysystems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40aa09b66c9a8cfa43bb39ef2a9d7d60?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxlibrary</media:title>
		</media:content>
	</item>
	</channel>
</rss>
