<?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/"
	>

<channel>
	<title>Think Lamp</title>
	<atom:link href="http://www.think-lamp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.think-lamp.com</link>
	<description></description>
	<lastBuildDate>Mon, 21 Sep 2009 15:50:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Image with same path doesn&#8217;t show up due to cache in browsers</title>
		<link>http://www.think-lamp.com/2009/09/image-with-same-path-doesnt-show-up-due-to-cache-in-browsers/</link>
		<comments>http://www.think-lamp.com/2009/09/image-with-same-path-doesnt-show-up-due-to-cache-in-browsers/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 15:50:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[image]]></category>

		<guid isPermaLink="false">http://www.think-lamp.com/?p=191</guid>
		<description><![CDATA[Browsers are designed to think that Images with same name don&#8217;t change rapidly so regularly.  This creates a problem in some cases where you have to reuse a  specific name Or a specific location for a system.

One such case can be a social network which is designed in a way where the profile images are [...]]]></description>
			<content:encoded><![CDATA[<p>Browsers are designed to think that Images with same name don&#8217;t change rapidly so regularly.  This creates a problem in some cases where you have to reuse a  specific name Or a specific location for a system.<br />
<span id="more-191"></span><br />
One such case can be a social network which is designed in a way where the profile images are always:</p>
<p><strong>http://www.mysite.com/users/images/user123/profile.jpg</strong></p>
<p>Now, on changing this image, sometimes browsers don&#8217;t clear cache and thus show the last image. In Order to solve this, use a random number at the end of the image location and you will be able to see that image. as browsers will not cache it.</p>
<p><strong>http://www.mysite.com/users/images/user123/profile.jpg?123</strong></p>
<p>One method that I used is:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$stamp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$imageLocation</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://www.mysite.com/users/images/user123/profile.jpg?'</span><span style="color: #339933;">.</span><span style="color: #000088;">$stamp</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$imageLocation</span></pre></div></div>

<p>This should work.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.think-lamp.com%2F2009%2F09%2Fimage-with-same-path-doesnt-show-up-due-to-cache-in-browsers%2F&amp;linkname=Image%20with%20same%20path%20doesn%26%238217%3Bt%20show%20up%20due%20to%20cache%20in%20browsers"><img src="http://www.think-lamp.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.think-lamp.com/2009/09/image-with-same-path-doesnt-show-up-due-to-cache-in-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fastest Insertion Sort in PHP</title>
		<link>http://www.think-lamp.com/2009/08/fastest-insertion-sort-in-php/</link>
		<comments>http://www.think-lamp.com/2009/08/fastest-insertion-sort-in-php/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 20:20:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[analysis of algorithms]]></category>
		<category><![CDATA[insertion sort]]></category>
		<category><![CDATA[sort]]></category>

		<guid isPermaLink="false">http://www.think-lamp.com/?p=189</guid>
		<description><![CDATA[
$numbers = array&#40;2,3,4,5,1,8,11,0&#41;;
$count = count&#40;$numbers&#41;;
&#160;
for&#40;$i=1;$i&#60;$count;$i++&#41;&#123;
	$j=$i-1;
	$key = $numbers&#91;$i&#93;;
	while&#40;$j&#62;=0 &#38;&#38; $numbers&#91;$j&#93; &#62;  $key&#41;&#123;
		$numbers&#91;$j+1&#93; = $numbers&#91;$j&#93;;
		$numbers&#91;$j&#93;= $key;
		$j= $j-1;		
	&#125;
&#125;
print_r&#40;$numbers&#41;;

]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$numbers</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">11</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numbers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$count</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$j</span><span style="color: #339933;">=</span><span style="color: #000088;">$i</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$numbers</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$j</span><span style="color: #339933;">&gt;=</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$numbers</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&gt;</span>  <span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$numbers</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$numbers</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$numbers</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> <span style="color: #000088;">$key</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$j</span><span style="color: #339933;">=</span> <span style="color: #000088;">$j</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>		
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numbers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.think-lamp.com%2F2009%2F08%2Ffastest-insertion-sort-in-php%2F&amp;linkname=Fastest%20Insertion%20Sort%20in%20PHP"><img src="http://www.think-lamp.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.think-lamp.com/2009/08/fastest-insertion-sort-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTTP sessions and background processes on Apache-PHP</title>
		<link>http://www.think-lamp.com/2009/04/http-sessions-and-background-processes-on-apache-php/</link>
		<comments>http://www.think-lamp.com/2009/04/http-sessions-and-background-processes-on-apache-php/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 21:08:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[background process]]></category>
		<category><![CDATA[file descriptor]]></category>
		<category><![CDATA[flock]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[session_start()]]></category>
		<category><![CDATA[session_write_close]]></category>

		<guid isPermaLink="false">http://www.think-lamp.com/?p=167</guid>
		<description><![CDATA[OK , so you are all excited about running a 10 minute process and you are happy that
you have set the processing as a background process, while the user can surf along your
website / CMS. If you are are using sessions, not quite smarty !

Consider this script [parentProcess.php]

$backgroundCall = 'php childProcess.php &#38;gt; /dev/null &#38;amp;';
&#160;
shell_exec&#40;$backgroundCall &#41;;
&#160;
echo [...]]]></description>
			<content:encoded><![CDATA[<p>OK , so you are all excited about running a 10 minute process and you are happy that<br />
you have set the processing as a background process, while the user can surf along your<br />
website / CMS. If you are are using sessions, not quite smarty !</p>
<p><span id="more-167"></span></p>
<p>Consider this script [parentProcess.php]</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$backgroundCall</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'php childProcess.php &amp;gt; /dev/null &amp;amp;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">shell_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$backgroundCall</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Hello world ! My background job is fired&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// other code , redirects etc</span></pre></div></div>

<p>When you call a background file with the &#8216;amersand&#8217; in the end, it sure becomes a background file.<br />
But it doesnot mean that the user will get control back of the browser. If you are using sessions,<br />
the webpage will be busy until the background process finishes execution.</p>
<p>Why is that ?</p>
<p><span style="color: #800000;"><em>[There is bug described <a href="http://bugs.php.net/bug.php?id=10675" target="_blank">here</a> and it is still not solved even in the php 5.0+ versions.]</em></span></p>
<p style="text-align: justify;">What happens is that the child process which is called by the <strong>system() ,exec() or shell_exec()</strong> command<br />
holds the file lock on the parent process, thus locking the session file.<br />
Thus, the session file being locked <strong>session_start();</strong> function cannot access the file.<br />
This is due to to open file descriptors locking the session file.Your entire session will be locked, so none of the pages of the website can be opened ( which are under session control )<br />
unless you change the browser or delete cookies.</p>
<h2><span style="color: #ff0000;">Solution:</span></h2>
<p>There are places on the internet which provide C code and perl code to do that. But PHP has its own<br />
function , which sadly is ignored <strong>session_write_close();</strong> This function can be used to trigger the close of session. Thus instructing the session<br />
that there is nothing to write until the next session start. Triggering this before firing background process will not hold locks on<br />
the session file.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$backgroundCall</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'php childProcess.php &amp;gt; /dev/null &amp;amp;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">session_write_close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">shell_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$backgroundCall</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Hello world ! My background job is fired&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// other code , redirects etc</span></pre></div></div>

<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.think-lamp.com%2F2009%2F04%2Fhttp-sessions-and-background-processes-on-apache-php%2F&amp;linkname=HTTP%20sessions%20and%20background%20processes%20on%20Apache-PHP"><img src="http://www.think-lamp.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.think-lamp.com/2009/04/http-sessions-and-background-processes-on-apache-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The (hidden) power of &#8216;ping&#8217;</title>
		<link>http://www.think-lamp.com/2009/03/the-hidden-power-of-ping/</link>
		<comments>http://www.think-lamp.com/2009/03/the-hidden-power-of-ping/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 23:50:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[LAN]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[ping]]></category>

		<guid isPermaLink="false">http://www.think-lamp.com/?p=108</guid>
		<description><![CDATA[PING

Ping is a Unix utility that sends ICMP ECHO to the server ( destination machine )  from the client ( originating machine ). It takes its name from a submarine sonar search &#8211; you send a short sound burst and listen for an echo &#8211; a ping &#8211; coming back. There is a myth [...]]]></description>
			<content:encoded><![CDATA[<h1 style="text-align: center;"><span style="color: #000000;">PING</span></h1>
<p><img class="aligncenter size-medium wp-image-109" title="echo" src="http://www.think-lamp.com/wp-content/uploads/2008/11/echo-300x178.jpg" alt="" width="300" height="178" /></p>
<p><strong>Ping </strong>is a Unix utility that sends ICMP ECHO to the server ( destination machine )  from the client ( originating machine ). It takes its name from a submarine sonar search &#8211; you send a short sound burst and listen for an echo &#8211; a <em>ping</em> &#8211; coming back. There is a myth that  Ping is actually an acronym for the words &#8216;Packet INternet Groper&#8217;, but there is no proven evidence to support the statement.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3741710014597097";
/* 468x15, created 3/25/09 */
google_ad_slot = "1110499399";
google_ad_width = 468;
google_ad_height = 15;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<p><span id="more-108"></span></p>
<p>For years, system admins, managers, developers, and the-next-door-jack have been using this utility, primarily to check if the <strong><em>&#8216;target system is alive&#8217;</em></strong><em><strong>. </strong></em>Ping, is thus undercredited by deeming it as an utility which has only one function.  &#8220;<span style="color: #333300;"><em><strong>Type in ping &lt;target_machine&gt; , if it gives response the machine is UP, if it doesn&#8217;t either machine is down OR network is down.</strong> </em></span>&#8220;NOT NECESSARILY TRUE!</p>
<h3><strong>What (other) Information can a  &#8216;ping&#8217; give you ? </strong></h3>
<ol>
<li> If the &lt;target_machine&gt; is alive  [ there are cases where this doesn't work ]</li>
<li>How long each packet exchange took</li>
<li>Interframe Gap</li>
<li>Reports other ICMP messages that might otherwise get buried in the system software</li>
<li>Exponential Moving Average</li>
<li>How occupied is the target system including the network that routes from host to the target.</li>
</ol>
<p>Now, how &#8216;you&#8217;  use this information to draw conclusions and metrics, is upon you. I&#8217;ll show some examples in the later part of this article.</p>
<p><em><strong>Lets see a sample Ping Output</strong></em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">-bash-<span style="color: #000000;">3.00</span>$ <span style="color: #c20cb9; font-weight: bold;">ping</span> www.google.com
PING www.l.google.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>64.233.169.104<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">56</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">84</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> bytes of data.
<span style="color: #000000;">64</span> bytes from yo-in-f104.google.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>64.233.169.104<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">246</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">time</span></span>=<span style="color: #000000;">7.97</span> ms
<span style="color: #000000;">64</span> bytes from yo-in-f104.google.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>64.233.169.104<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">246</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">time</span></span>=<span style="color: #000000;">13.7</span> ms
<span style="color: #000000;">64</span> bytes from yo-in-f104.google.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>64.233.169.104<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">2</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">246</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">time</span></span>=<span style="color: #000000;">9.69</span> ms
<span style="color: #000000;">64</span> bytes from yo-in-f104.google.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>64.233.169.104<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">3</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">246</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">time</span></span>=<span style="color: #000000;">8.15</span> ms
&nbsp;
<span style="color: #660033;">---</span> www.l.google.com <span style="color: #c20cb9; font-weight: bold;">ping</span> statistics <span style="color: #660033;">---</span>
<span style="color: #000000;">4</span> packets transmitted, <span style="color: #000000;">4</span> received, <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> packet loss
rtt min<span style="color: #000000; font-weight: bold;">/</span>avg<span style="color: #000000; font-weight: bold;">/</span>max<span style="color: #000000; font-weight: bold;">/</span>mdev = <span style="color: #000000;">7.971</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">9.884</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">13.716</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.313</span> ms</pre></div></div>

<p>pretty normal eh ! Whats so new in that ?<br />
Now, I can bet 50% of people who read this may not know the significance of all the digits or abbreviations in the output. It is a good idea to have a detailed knowledge of it in order to understand what is actually happening.<br />
This will also help you to change the data in order to detect certain problems.</p>
<p><strong>1.</strong> When you ping www.google.com it replies www.l.google.com which is actually a CNAME in the DNS database.<br />
<strong>2.</strong> The second line has the IP address of the host that is found. This IP address is found from the DNS query to the DNS database. ( I will be writing an article about how the DNS query actually works ! Watch out for it )<br />
<strong>3.</strong> Line two has two numbers (56 and 84 ) as bytes of data while all the reply has another (64) bytes of data. Now what are these ?</p>
<p>PING is an ICMP Packet with  20 bytes of IP header + 8 bytes ICMP header  + XX byes of data ( or call it the payload )</p>
<p>IN default case, the whole frame is set to 64 bytes That is 20 IP header + 8 ICMP header + 56 bytes of payload. That is how you get all these numbers .. never thought of it isn&#8217;t it ?</p>
<div class="wp-caption aligncenter" style="width: 522px"><img title="ICMP Packet" src="http://www.caida.org/tools/measurement/skitter/packets/skitter_ttl_out_pkt.gif" alt="image reference : www.caida.org" width="512" height="309" /><p class="wp-caption-text">image reference : www.caida.org</p></div>
<p><strong>4. </strong>The next four lines show the successful reply from the IP address and their reverse DNS host names. See how the host names actually differ in all the first three lines of the output  ? That is the magic of DNS and load balancing, which I will be discussing in a n separate article.</p>
<p><strong>5.</strong> These also have 3 major things: (a) icmp_seq  (b)ttl and (c)time in miliseconds</p>
<p><strong>(a) icmp_seq </strong>number is the sequence number of packets that are transmitted and received back by the client. If a sequence number is missing OR if there is a gap in the sequence number that means that the client is sending more than what the server can take. It is called source quench. As ICMP is a lower level protocol it can only detect errors not correct it ( as IP or TCP does ).</p>
<h3><em><strong>how to  simulate source quench ? </strong></em></h3>
<div id="attachment_140" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.think-lamp.com/wp-content/uploads/2009/03/echo_point.jpg"><img class="size-medium wp-image-140" title="Echo " src="http://www.think-lamp.com/wp-content/uploads/2009/03/echo_point-300x204.jpg" alt="Image Courtesy: www.cartoonstock.com" width="300" height="204" /></a><p class="wp-caption-text">Image Courtesy: www.cartoonstock.com</p></div>
<p>You can use the command -i0 :this switch will set interval to 0 , this means that the client will continuously keep on sending packets without waiting for a response from the server. This will result in server getting busy and thus dropping packets.<br />
You can also use the switch -s500 : this switch will set the payload along with ICMP header size to 500 and the server has to accept and process more data from the server ( A ping with packet larger than 64 is called <strong><span style="text-decoration: underline;">The Ping of Death</span></strong> )<br />
You can use both at the same time to get good results</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ping</span> <span style="color: #660033;">-i0</span> <span style="color: #660033;">-s500</span> www.google.com</pre></div></div>

<p><span style="text-decoration: underline;">Lets see an output:</span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">64</span> bytes from host232.hostmonster.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>74.220.215.232<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">24</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">50</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">time</span></span>=<span style="color: #000000;">114</span> ms
<span style="color: #000000;">64</span> bytes from host232.hostmonster.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>74.220.215.232<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">25</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">50</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">time</span></span>=<span style="color: #000000;">123</span> ms
<span style="color: #000000;">64</span> bytes from host232.hostmonster.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>74.220.215.232<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">27</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">50</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">time</span></span>=<span style="color: #000000;">112</span> ms</pre></div></div>

<p>Here we see that the icmp sequence number 26 is lost. This indicates that the server is busy and thus cannot accept data at these throughputs.<strong> <span style="color: #993300;">Now, in production environment something like this can be used to  compare  past &#8216;good&#8217; results to a problem scenario. If all of a sudden you find that there is a large packet drop on the ping with the normal 64 byte 0 second interval packets, you can judge that there could be something wrong with the either devices OR the network pipe OR the internet connection itself could be slow. Comparing these figures on a different server / different network  / different subnet would help you determine the problem area, and in some cases you can actually pinpoint the culprit. </span></strong></p>
<p><strong>(b) TTL</strong></p>
<p>Any IP packet that gets sent out will have a TTL field which normally is set to a relatively high number (in the case of ping the default  TTL is 255). As the packet traverses the network, the TTL field gets decreased by one by each HOP ( or router ) it goes through; when the TTL drops to 0, the packet is discarded by the router. The IP specification says that the TTL should be set to 60 (though it&#8217;s 255 for ping packets). The main purpose of this is so that a packet doesn&#8217;t live forever on the network and will eventually die when it is deemed &#8220;lost.&#8221; But for ping purposes, it provides additional information. The TTL can be used to determine approximately how many router hops the packet has gone through. If the TTL field varies in successive pings, it could indicate that the successive reply packets are going via different routes, which isn&#8217;t a great thing.</p>
<p>So a TTL of 245 for gogole.com means that it took (255-245 = ) 10 hops to reach google.com server.<br />
<strong><span style="color: #993300;">On a production environment, in a ping output a low TTL means that it took the packet higher number of hops to reach to the destination. Time to check your network routing table ?</span></strong></p>
<p><strong>(c) time</strong></p>
<p>The time is the time in milliseconds (ms) that it took to reach to the source and back. <span style="color: #993300;"><span style="color: #000000;">Thus it is also called RTT or the Round Trip Time</span>.</span><strong><span style="color: #993300;"> In a production environment a HIGH  RTT suggests that there is a congestion in the network. </span></strong></p>
<p><strong>6.</strong> After the ping terminates ( normally ctrl+c  OR with a switch -c&lt;#&gt; where &lt;#&gt; is the count before termination ) you will see number of packets transmitted, number failed and the percentage failed. In this example output its a 100% success but In the above source quench example we can see the number of packets failed and the percentage non zero.</p>
<p><strong>7.</strong> The min/avg/max/mdev is the  minimum / average / maximum / standard deviation of the round trip times. To have a good number and analysis, send at least  50 to 100 packets.</p>
<h3><strong>What else ?</strong></h3>
<p style="text-align: center;"><a href="http://www.think-lamp.com/wp-content/uploads/2009/03/english_echo.jpg"><img class="size-medium wp-image-141 aligncenter" title="Give something get something" src="http://www.think-lamp.com/wp-content/uploads/2009/03/english_echo.jpg" alt="" width="300" height="300" /></a></p>
<p>Lets take a look at the end of the output:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">64</span> bytes from yo-in-f99.google.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>64.233.169.99<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">29</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">245</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>truncated<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #660033;">---</span> www.l.google.com <span style="color: #c20cb9; font-weight: bold;">ping</span> statistics <span style="color: #660033;">---</span>
<span style="color: #000000;">30</span> packets transmitted, <span style="color: #000000;">30</span> received, <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> packet loss, <span style="color: #000000; font-weight: bold;">time</span> 540ms
rtt min<span style="color: #000000; font-weight: bold;">/</span>avg<span style="color: #000000; font-weight: bold;">/</span>max<span style="color: #000000; font-weight: bold;">/</span>mdev = <span style="color: #000000;">7.560</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">7.996</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">8.609</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.257</span> ms,  ipg<span style="color: #000000; font-weight: bold;">/</span>ewma <span style="color: #000000;">18.632</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">7.945</span> ms</pre></div></div>

<p>Focus on the line: ipg/ewma . That is: inter-packet gap / exponential moving average.</p>
<p><strong>InterPacket Gap (measured in seconds)</strong></p>
<p>The Inter-packet gap (or the inter-frame gap) is an idle time period appended to the end of every frame by the ethernet adapter. This idle time gives the network media a chance to stabilize, and other network components time to process the frame. On specifying the i0 or the -f switch in ping we can get the output resulting ping statistics which gives the current ipg of the system.<br />
The minimum interframe gap is 96 bit times (the time it takes to transmit 96 bits of raw data on the medium), which is<br />
9.6 μs for 10 Mbit/s Ethernet,<br />
960 ns for 100 Mbit/s (fast) Ethernet,<br />
96 ns for 1 Gbit/s (gigabit) Ethernet, and<br />
9.6 ns for 10 Gbit/s (10 gigabit) Ethernet.<br />
This is the minimum gap as specified in Ethernet protocol and required for a non-colliding transmission. There are ways to reduce it for a faster UDP transmissions, but can cause heavy collisions if other devices ( client and server ) aren&#8217;t able to handle the high rate of transmission.</p>
<p>In ideal situations for a 10 Mbps line and 9.6 μs of IFG the loss is 14.28%</p>
<p style="text-align: center;"><a href="http://www.think-lamp.com/wp-content/uploads/2009/03/ifg_calc.gif"><img class="size-medium wp-image-143 aligncenter" title="ifg calculations" src="http://www.think-lamp.com/wp-content/uploads/2009/03/ifg_calc.gif" alt="" width="300" height="286" /></a></p>
<p style="text-align: left;"><strong><span style="color: #993300;">Now, once you have the ifg and your Ethernet pipe speed. You can easily determine the network efficiency.</span></strong></p>
<p><strong>Exponential Weighted Moving Average (measured in seconds)</strong></p>
<p>Estimated packet rate is used to identify abnormal activities and attacks. The ethernet adapter estimates the arrival of the next packet based on the information of previous packet. If the packet time is more it will go to sleep (saving power).<br />
Although I want to I cannot talk a lot about EWMA as it is beyond the scope of this article, but on a <strong><span style="color: #993300;">production system  A quick look at the rtt and ewma will tell you if something is wrong. rtt ~ ewma  for regular case. </span></strong></p>
<p>During operations, the effective idletime is measured using an exponential weighted moving average (EWMA), which considers recent packets to be exponentially more important than past ones. The Unix loadaverage is calculated in the same way.<br />
The calculated idle time is subtracted from the EWMA measured one, the resulting number is called &#8216;avgidle&#8217;. A perfectly loaded link has an avgidle of zero: packets arrive exactly at the calculated interval.</p>
<p><span style="font-family: Courier New;"><small></small></span></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.think-lamp.com%2F2009%2F03%2Fthe-hidden-power-of-ping%2F&amp;linkname=The%20%28hidden%29%20power%20of%20%26%238216%3Bping%26%238217%3B"><img src="http://www.think-lamp.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.think-lamp.com/2009/03/the-hidden-power-of-ping/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>What Rasmus Lerdorf is talking about AJAX</title>
		<link>http://www.think-lamp.com/2009/02/what-rasmus-lerdorf-is-talking-about-ajax/</link>
		<comments>http://www.think-lamp.com/2009/02/what-rasmus-lerdorf-is-talking-about-ajax/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 08:08:58 +0000</pubDate>
		<dc:creator>kinjal.ch</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://www.think-lamp.com/?p=136</guid>
		<description><![CDATA[Are you blindly following any ajax library to work your way.
Take a look what Rasmus is talking about AJAX
He follows the rule of simplicity as he described in his framework approach.

The very basic of ajax structure -
Javascript
function createRequestObject() {
var ro;
var browser = navigator.appName;
if(browser == &#8220;Microsoft Internet Explorer&#8221;){
ro = new ActiveXObject(&#8221;Microsoft.XMLHTTP&#8221;);
}else{
ro = new XMLHttpRequest();
}
return ro;
}
var http [...]]]></description>
			<content:encoded><![CDATA[<p>Are you blindly following any ajax library to work your way.</p>
<p>Take a look what <a href="http://news.php.net/php.general/219164" target="_blank">Rasmus is talking about AJAX</a></p>
<p>He follows the rule of simplicity as he described in his framework approach.</p>
<p><span id="more-136"></span></p>
<p>The very basic of ajax structure -</p>
<p><strong>Javascript</strong></p>
<p>function createRequestObject() {</p>
<p>var ro;</p>
<p>var browser = navigator.appName;</p>
<p>if(browser == &#8220;Microsoft Internet Explorer&#8221;){</p>
<p>ro = new ActiveXObject(&#8221;Microsoft.XMLHTTP&#8221;);</p>
<p>}else{</p>
<p>ro = new XMLHttpRequest();</p>
<p>}</p>
<p>return ro;</p>
<p>}</p>
<p>var http = createRequestObject();</p>
<p>function sndReq(action) {</p>
<p>http.open(&#8217;get&#8217;, &#8216;rpc.php?action=&#8217;+action);</p>
<p>http.onreadystatechange = handleResponse;</p>
<p>http.send(null);</p>
<p>}</p>
<p>function handleResponse() {</p>
<p>if(http.readyState == 4){</p>
<p>var response = http.responseText;</p>
<p>var update = new Array();</p>
<p>if(response.indexOf(&#8217;|&#8217; != -1)) {</p>
<p>update = response.split(&#8217;|');</p>
<p>document.getElementById(update[0]).innerHTML = update[1];</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p><strong>HTML</strong></p>
<p>&lt;a href=&#8221;javascript:sndReq(&#8217;foo&#8217;)&#8221;&gt;[foo]&lt;/a&gt;</p>
<p>&lt;div id=&#8221;foo&#8221; /&gt;</p>
<p>server side script(<strong>rpc.php</strong>) -</p>
<p>switch($_REQUEST['action']) {</p>
<p>case &#8216;foo&#8217;:</p>
<p>/* do something */</p>
<p>echo &#8220;foo|foo done&#8221;;</p>
<p>break;</p>
<p>&#8230;</p>
<p>}</p>
<p>Thats all. Everything else is just building on top of this.</p>
<p>Source : <a href="http://news.php.net/php.general/219164" target="_blank">http://news.php.net/php.general/219164</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.think-lamp.com%2F2009%2F02%2Fwhat-rasmus-lerdorf-is-talking-about-ajax%2F&amp;linkname=What%20Rasmus%20Lerdorf%20is%20talking%20about%20AJAX"><img src="http://www.think-lamp.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.think-lamp.com/2009/02/what-rasmus-lerdorf-is-talking-about-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best practices for faster Web Pages</title>
		<link>http://www.think-lamp.com/2009/01/best-practices-for-fatser-web-pages/</link>
		<comments>http://www.think-lamp.com/2009/01/best-practices-for-fatser-web-pages/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 12:34:26 +0000</pubDate>
		<dc:creator>kinjal.ch</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.think-lamp.com/?p=130</guid>
		<description><![CDATA[A few best practices for web page performance
1.Make Fewer HTTP Requests
2.Use a Content Delivery Network

3.Add an Expires Header
4.Gzip Components
5.Put CSS at the Top
6.Move Scripts to the Bottom
7.Avoid CSS Expressions
8.Make JavaScript and CSS External
9.Reduce DNS Lookups
10.Minify JavaScript
11.Avoid Redirects
12.Remove Duplicate Scripts
13.Configure ETags
14.Make Ajax Cacheable
15.Flush the Buffer Early
16.Use GET for AJAX Requests
17.Post-load Components
18.Preload Components
19.Reduce the Number of DOM [...]]]></description>
			<content:encoded><![CDATA[<p>A few best practices for web page performance</p>
<p>1.<strong>Make Fewer HTTP Requests</strong></p>
<p>2.<strong>Use a Content Delivery Network</strong></p>
<p><span id="more-130"></span></p>
<p>3.<strong>Add an Expires Header</strong></p>
<p>4.<strong>Gzip Components</strong></p>
<p>5.<strong>Put CSS at the Top</strong></p>
<p>6.<strong>Move Scripts to the Bottom</strong></p>
<p>7.<strong>Avoid CSS Expressions</strong></p>
<p>8.<strong>Make JavaScript and CSS External</strong></p>
<p>9.<strong>Reduce DNS Lookups</strong></p>
<p>10.<strong>Minify JavaScript</strong></p>
<p>11.<strong>Avoid Redirects</strong></p>
<p>12.<strong>Remove Duplicate Scripts</strong></p>
<p>13.<strong>Configure ETags</strong></p>
<p>14.<strong>Make Ajax Cacheable</strong></p>
<p>15.<strong>Flush the Buffer Early</strong></p>
<p>16.<strong>Use GET for AJAX Requests</strong></p>
<p>17.<strong>Post-load Components</strong></p>
<p>18.<strong>Preload Components</strong></p>
<p>19.<strong>Reduce the Number of DOM Elements</strong></p>
<p>20.<strong>Split Components Across Domains</strong></p>
<p>22.<strong>Minimize the Number of iframes</strong></p>
<p>23.<strong>No 404s</strong></p>
<p>24.<strong>Reduce Cookie Size</strong></p>
<p>25.<strong>Use Cookie-free Domains for Components</strong></p>
<p>26.<strong>Minimize DOM Access</strong></p>
<p>27.<strong>Develop Smart Event Handlers</strong></p>
<p>28.<strong>Choose &lt;link&gt; over @import</strong></p>
<p>29.<strong>Avoid Filters</strong></p>
<p>30.<strong>Optimize Images</strong></p>
<p>31.<strong>Optimize CSS Sprites</strong></p>
<p>32.<strong>Don&#8217;t Scale Images in HTML</strong></p>
<p>33.<strong>Make favicon.ico Small and Cacheable</strong></p>
<p>34.<strong>Keep Components under 25K</strong></p>
<p>35.<strong>Pack Components into a Multipart Document</strong></p>
<p>Source : Yahoo Developer Newtwrok</p>
<p><a href="http://developer.yahoo.com/performance/rules.html" target="_blank">Click for detailed info</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.think-lamp.com%2F2009%2F01%2Fbest-practices-for-fatser-web-pages%2F&amp;linkname=Best%20practices%20for%20faster%20Web%20Pages"><img src="http://www.think-lamp.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.think-lamp.com/2009/01/best-practices-for-fatser-web-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs for PHP</title>
		<link>http://www.think-lamp.com/2008/12/emacs-for-php/</link>
		<comments>http://www.think-lamp.com/2008/12/emacs-for-php/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 10:54:35 +0000</pubDate>
		<dc:creator>kinjal.ch</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.think-lamp.com/?p=127</guid>
		<description><![CDATA[1.download php-mode.el from http://sourceforge.net/projects/php-mode/
2. copy php-mode.el to emacs/lisp/
3.byte compile php-mode.el file to get php-mode.elc file
command:  M-x byte-compile-file
4.add following lines to you .emacs file
(require &#8216;php-mode)
(add-to-list &#8216;auto-mode-alist &#8216;(&#8221;\\.module$&#8221; . php-mode))
(add-to-list &#8216;auto-mode-alist &#8216;(&#8221;\\.inc$&#8221; . php-mode))
(add-to-list &#8216;auto-mode-alist &#8216;(&#8221;\\.install$&#8221; . php-mode))
(add-to-list &#8216;auto-mode-alist &#8216;(&#8221;\\.engine$&#8221; . php-mode))
done! emacs is ready to support php.
try C-c C-f on built in php function
]]></description>
			<content:encoded><![CDATA[<p>1.download php-mode.el from <a href="http://sourceforge.net/projects/php-mode/">http://sourceforge.net/projects/php-mode/</a></p>
<p>2. copy php-mode.el to emacs/lisp/</p>
<p>3.byte compile php-mode.el file to get php-mode.elc file</p>
<p>command:  M-x byte-compile-file</p>
<p>4.add following lines to you .emacs file</p>
<p>(require &#8216;php-mode)</p>
<p>(add-to-list &#8216;auto-mode-alist &#8216;(&#8221;\\.module$&#8221; . php-mode))</p>
<p>(add-to-list &#8216;auto-mode-alist &#8216;(&#8221;\\.inc$&#8221; . php-mode))</p>
<p>(add-to-list &#8216;auto-mode-alist &#8216;(&#8221;\\.install$&#8221; . php-mode))</p>
<p>(add-to-list &#8216;auto-mode-alist &#8216;(&#8221;\\.engine$&#8221; . php-mode))</p>
<p>done! emacs is ready to support php.</p>
<p>try C-c C-f on built in php function</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.think-lamp.com%2F2008%2F12%2Femacs-for-php%2F&amp;linkname=Emacs%20for%20PHP"><img src="http://www.think-lamp.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.think-lamp.com/2008/12/emacs-for-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple SQL Queries in a Stored Procedure.</title>
		<link>http://www.think-lamp.com/2008/12/multiple-sql-queries-in-a-stored-procedure/</link>
		<comments>http://www.think-lamp.com/2008/12/multiple-sql-queries-in-a-stored-procedure/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 21:21:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[stored procedure]]></category>
		<category><![CDATA[sybase]]></category>

		<guid isPermaLink="false">http://www.think-lamp.com/?p=121</guid>
		<description><![CDATA[Working on a Thursday afternoon, I came across a problem where we had to return multiple counts (about 10 of them ) in an application. One way was to have multiple stored procedures and call them one by one, but this would mean I would have to make 10 connections to the database and 10 [...]]]></description>
			<content:encoded><![CDATA[<div class="Q2bXSc">Working on a Thursday afternoon, I came across a problem where we had to <strong>return multiple counts</strong> (about 10 of them ) in an application. One way was to have multiple stored procedures and call them one by one, but this would mean I would have to make 10 connections to the database and 10 opens , 10 closes, phew !</div>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3741710014597097";
/* 468x15, created 3/25/09 */
google_ad_slot = "1110499399";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<div class="Q2bXSc">So I decided to combine all of them into one:</div>
<div class="Q2bXSc"><span id="more-121"></span></div>
<div class="RNCQof">
<div class="Q2bXSc"><strong><span id=":1rj"></p>
<pre>SELECT "totaltrees" =(SELECT count(*)  FROM Forest f  WHERE f.trees= @forestId),
"totalplants" =(SELECT count(*)  FROM Forest f WHERE f.plants= @forestId),
"totalUsers"=(SELECT count(*)  FROM Users u WHERE u.groupId= @groupId)</pre>
<p></span></strong></div>
</div>
<div class="Q2bXSc">Here you can add as many as queries you want and from different tables, counts, columns etc. Just one thing, The result of each query should have a unique value, thus you can&#8217;t do select *  !!</div>
<div class="Q2bXSc">Or something like: select country_name FROM world.</div>
<div class="Q2bXSc">cool ! isn&#8217;t it ?</div>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.think-lamp.com%2F2008%2F12%2Fmultiple-sql-queries-in-a-stored-procedure%2F&amp;linkname=Multiple%20SQL%20Queries%20in%20a%20Stored%20Procedure."><img src="http://www.think-lamp.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.think-lamp.com/2008/12/multiple-sql-queries-in-a-stored-procedure/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Very Useful Linux/Unix Commands</title>
		<link>http://www.think-lamp.com/2008/11/very-useful-linuxunix-commands/</link>
		<comments>http://www.think-lamp.com/2008/11/very-useful-linuxunix-commands/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 04:44:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[linux commands]]></category>
		<category><![CDATA[unix commands]]></category>

		<guid isPermaLink="false">http://www.think-lamp.com/?p=78</guid>
		<description><![CDATA[Working on a *nix system is no piece of cake. Especially when you are used to Graphic interface of &#8216;windows&#8217;. The world where mouse is the king.
Here is  a list of most used / most discussed / most important  *nix commands. Mastering this will surely get your confidence level high in the black background and [...]]]></description>
			<content:encoded><![CDATA[<p>Working on a *nix system is no piece of cake. Especially when you are used to Graphic interface of &#8216;windows&#8217;. The world where mouse is the king.</p>
<p>Here is  a list of most used / most discussed / most important  *nix commands. Mastering this will surely get your confidence level high in the black background and white characters&#8217; world !!</p>
<p>My experience says that for starters in UNiX / LiNuX , these commands are enough to get you in smoothly ! <img src='http://www.think-lamp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   <span id="more-78"></span></p>
<p><span style="color: #993300;"><span style="font-size: medium;"><strong>clear</strong></span></span> <a href="http://linux.die.net/man/1/clear" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Clears the terminal window</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">clear</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>ls</strong></span></span> <a href="http://linux.die.net/man/1/ls" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>List contents of a directory<br />
</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">ls</span>  <span style="color: #660033;">-l</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>cat</strong></span></span> <a href="http://linux.die.net/man/1/cat" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays the contents of a file in the terminal</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cat</span> filename.extension</pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>rm</strong></span></span> <a href="http://linux.die.net/man/1/rm" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Removes a file</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">rm</span> filename.extension
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-i</span> filename.extension  <span style="color: #7a0874; font-weight: bold;">&#91;</span>prompts <span style="color: #000000; font-weight: bold;">for</span> confirmation before removing a <span style="color: #c20cb9; font-weight: bold;">file</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> filename.extension  <span style="color: #7a0874; font-weight: bold;">&#91;</span>force removal of the <span style="color: #c20cb9; font-weight: bold;">file</span> regardless of it bieng write-protected or open<span style="color: #7a0874; font-weight: bold;">&#93;</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> directory		   <span style="color: #7a0874; font-weight: bold;">&#91;</span>remove files recursively <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">'directory'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>cp</strong></span></span> <a href="http://linux.die.net/man/1/cp" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Copies a file</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cp</span> file1.ext file2.ext
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cp</span> file1.ext <span style="color: #000000; font-weight: bold;">/</span>some<span style="color: #000000; font-weight: bold;">/</span>other<span style="color: #000000; font-weight: bold;">/</span>location<span style="color: #000000; font-weight: bold;">/</span>file2.ext
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cp</span> file1.ext user<span style="color: #000000; font-weight: bold;">@</span>some.other.server:~<span style="color: #000000; font-weight: bold;">/</span>some<span style="color: #000000; font-weight: bold;">/</span>other<span style="color: #000000; font-weight: bold;">/</span>location<span style="color: #000000; font-weight: bold;">/</span>file2.ext</pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>passwd</strong></span></span> <a href="http://linux.die.net/man/1/passwd" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Changes password</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">passwd</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">passwd</span> SomeNewUser <span style="color: #7a0874; font-weight: bold;">&#91;</span>root access only<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>motd</strong></span></span> <a href="http://linux.die.net/man/1/motd" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Message of the Day</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ motd</pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>finger</strong></span></span> <a href="http://linux.die.net/man/1/finger" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>User information lookup program</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ finger   <span style="color: #660033;">-p</span>
Login     Name       Tty      Idle  Login Time   Office     Office Phone
xuser              pts<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span>          Oct <span style="color: #000000;">22</span> <span style="color: #000000;">22</span>:04 <span style="color: #7a0874; font-weight: bold;">&#40;</span>ool-4578671d.dyn.optonline.net<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>startx</strong></span></span> <a href="http://linux.die.net/man/1/startx" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Starts an X Window System server</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$  startx <span style="color: #660033;">-dpi</span> <span style="color: #000000;">300</span> <span style="color: #660033;">-depth</span> <span style="color: #000000;">32</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>less</strong></span></span> <a href="http://linux.die.net/man/1/less" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays the contents of a file in the terminal one page at a time</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">less</span> filename.ext
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">less</span> +G filename.ext <span style="color: #7a0874; font-weight: bold;">&#91;</span>start from end<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>info</strong></span></span> <a href="http://linux.die.net/man/1/info" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays information and documentation on shells, utilities and programs</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ info
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ info <span style="color: #c20cb9; font-weight: bold;">less</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>lpr</strong></span></span> <a href="http://linux.die.net/man/1/lpr" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Sends file to printer</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">lpr</span> filename.ext
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">lpr</span> -<span style="color: #666666; font-style: italic;"># 3 filename.ext [3 copies]</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>grep</strong></span></span> <a href="http://linux.die.net/man/1/grep" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>looks through files for strings</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;needle&quot;</span> haystack.ext
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;neEdlE&quot;</span> haystack.ext
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-r</span> <span style="color: #ff0000;">&quot;neEdlE&quot;</span> directory<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>head</strong></span></span> <a href="http://linux.die.net/man/1/head" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays first 10 lines of file</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">head</span> filename.ext</pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>tail</strong></span></span> <a href="http://linux.die.net/man/1/tail" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays last 10 lines of file</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">tail</span> filename.log
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-f</span> filename.log <span style="color: #7a0874; font-weight: bold;">&#91;</span>don<span style="color: #ff0000;">'t exit // realtime]</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>mv</strong></span></span> <a href="http://linux.die.net/man/1/mv" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Moves or renames file</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">mv</span> filename.ext <span style="color: #000000; font-weight: bold;">/</span>some<span style="color: #000000; font-weight: bold;">/</span>other<span style="color: #000000; font-weight: bold;">/</span>directory<span style="color: #000000; font-weight: bold;">/</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">mv</span> filename.ext newname.ext <span style="color: #7a0874; font-weight: bold;">&#91;</span>rename<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>file</strong></span></span> <a href="http://linux.die.net/man/1/file" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays information about file contents</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">file</span> program.php
program.php: PHP script text
&nbsp;
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">file</span> archive.tar.gz
archive.tar.gz: <span style="color: #c20cb9; font-weight: bold;">gzip</span> compressed data, from Unix</pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>echo</strong></span></span> <a href="http://linux.die.net/man/1/echo" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Copies string to terminal</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$  <span style="color: #7a0874; font-weight: bold;">echo</span> Hello Think-Lamp
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>date</strong></span></span> <a href="http://linux.die.net/man/1/date" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays current date and time</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">date</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #660033;">-R</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>cal</strong></span></span> <a href="http://linux.die.net/man/1/cal" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays calendar</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cal</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cal</span> <span style="color: #660033;">-y</span> <span style="color: #000000;">2009</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>gzip</strong></span></span> <a href="http://linux.die.net/man/1/gzip" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Compresses a file</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">gzip</span> filename.etx <span style="color: #000000; font-weight: bold;">&amp;</span>gt; archive.gz
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-f</span> <span style="color: #660033;">-q</span> filename.etx  <span style="color: #000000; font-weight: bold;">&amp;</span>gt; archive.gz<span style="color: #7a0874; font-weight: bold;">&#91;</span>force and supress errors<span style="color: #7a0874; font-weight: bold;">&#93;</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-f</span> <span style="color: #660033;">-q</span> <span style="color: #660033;">-r</span> directory<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; archive.gz</pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>gunzip</strong></span></span> <a href="http://linux.die.net/man/1/gunzip" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Decompresses a compressed file</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">gunzip</span> archive.gz</pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>which</strong></span></span> <a href="http://linux.die.net/man/1/which" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays path to command</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">which</span> <span style="color: #7a0874; font-weight: bold;">echo</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">which</span> <span style="color: #c20cb9; font-weight: bold;">less</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>whereis</strong></span></span> <a href="http://linux.die.net/man/1/whereis" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays paths to locations of commands</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">whereis</span> <span style="color: #7a0874; font-weight: bold;">echo</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">whereis</span> <span style="color: #c20cb9; font-weight: bold;">less</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>who</strong></span></span> <a href="http://linux.die.net/man/1/who" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Lists currently logged on users</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">who</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">who</span> <span style="color: #660033;">-b</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>w</strong></span></span> <a href="http://linux.die.net/man/1/w" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Lists currently logged on users with processing usage</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">w</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>mesg</strong></span></span> <a href="http://linux.die.net/man/1/mesg" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Sets options for letting other users write you messages</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">mesg</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>write</strong></span></span> <a href="http://linux.die.net/man/1/write" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><strong><span style="color: #993300;"><span style="font-size: small;"> </span></span>Sends message to other users</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">write</span> xuser
hello<span style="color: #000000; font-weight: bold;">!</span> This is <span style="color: #7a0874; font-weight: bold;">test</span> message
&nbsp;
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>xuser<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$
Message from <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ on pts<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span> at <span style="color: #000000;">13</span>:<span style="color: #000000;">25</span> ...
hello<span style="color: #000000; font-weight: bold;">!</span> This is <span style="color: #7a0874; font-weight: bold;">test</span> message</pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>talk</strong></span></span> <a href="http://linux.die.net/man/1/talk" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Allows two way chat to other users</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ talk xuser<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>
&nbsp;
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>xuser<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$
Message from root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>
talk: connection requested by root<span style="color: #000000; font-weight: bold;">@</span>test.
talk: respond with: talk xuser<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>chmod</strong></span></span> <a href="http://linux.die.net/man/1/chmod" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Changes file access permissions</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">775</span> file.ext
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-r</span> <span style="color: #000000;">777</span> directory<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
CHMOD can also to attributed by using Numeric Permissions:
&nbsp;
<span style="color: #000000;">400</span> <span style="color: #c20cb9; font-weight: bold;">read</span> by owner
040 <span style="color: #c20cb9; font-weight: bold;">read</span> by group
004 <span style="color: #c20cb9; font-weight: bold;">read</span> by anybody <span style="color: #7a0874; font-weight: bold;">&#40;</span>other<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000;">200</span> <span style="color: #c20cb9; font-weight: bold;">write</span> by owner
020 <span style="color: #c20cb9; font-weight: bold;">write</span> by group
002 <span style="color: #c20cb9; font-weight: bold;">write</span> by anybody
<span style="color: #000000;">100</span> execute by owner
010 execute by group
001 execute by anybody
____
<span style="color: #000000;">777</span>  read<span style="color: #000000; font-weight: bold;">/</span>write<span style="color: #000000; font-weight: bold;">/</span>execute by everybody <span style="color: #000000; font-weight: bold;">!</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>mkdir</strong></span></span> <a href="http://linux.die.net/man/1/mkdir" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Makes a directory</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> newdirectory</pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>rmdir</strong></span></span> <a href="http://linux.die.net/man/1/rmdir" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Removes an empty directory</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">rmdir</span> newdirectory</pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>ln</strong></span></span> <a href="http://linux.die.net/man/1/ln" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Creates link to an existing file [<a href="http://www.computerhope.com/jargon/h/hardlink.htm" target="_blank">hard</a>, <a href="http://www.computerhope.com/jargon/s/symblink.htm" target="_blank">soft</a>] </strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#40;</span>hard <span style="color: #c20cb9; font-weight: bold;">link</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">ln</span> targetfile.ext linkname.ext
usage: <span style="color: #7a0874; font-weight: bold;">&#40;</span>soft <span style="color: #c20cb9; font-weight: bold;">link</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> targetfile.ext linkname.ext</pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>df</strong></span></span> <a href="http://linux.die.net/man/1/df" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays all mounted filesystems</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">df</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">df</span> <span style="color: #660033;">-h</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>top</strong></span></span> <a href="http://linux.die.net/man/1/top" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays updating list of currently running processes</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span> top
<span style="color: #666666; font-style: italic;"># Once in  TOP screen, use shift+F to select 'sort by' field.</span>
<span style="color: #666666; font-style: italic;"># Once in Top screen, use Shift+R to 'sort' ascending OR descending</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>tty</strong></span></span> <a href="http://linux.die.net/man/1/tty" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays the name of the terminal in which the command was issued</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span> tty</pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>kill</strong></span></span> <a href="http://linux.die.net/man/1/kill" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Aborts a process by PID (Process Identification Number) or job number</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #660033;">-p</span> <span style="color: #000000;">2345</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>jobs</strong></span></span> <a href="http://linux.die.net/man/1/jobs" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays a list of current jobs</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">jobs</span>
usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">jobs</span> <span style="color: #660033;">-l</span></pre></div></div>

<p><span style="color: #993300;"><span style="font-size: medium;"><strong>netstat</strong></span></span> <a href="http://linux.die.net/man/1/netstat" target="_blank"><img class="alignnone size-medium wp-image-79" title="book" src="http://www.think-lamp.com/wp-content/uploads/2008/10/book.gif" alt="" width="19" height="11" /></a><span style="color: #993300;"><span style="font-size: small;"><strong> </strong></span></span><strong>Displays network connections</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">netstat</span> <span style="color: #660033;">-a</span> <span style="color: #660033;">-e</span></pre></div></div>

<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.think-lamp.com%2F2008%2F11%2Fvery-useful-linuxunix-commands%2F&amp;linkname=Very%20Useful%20Linux%2FUnix%20Commands"><img src="http://www.think-lamp.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.think-lamp.com/2008/11/very-useful-linuxunix-commands/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>AWK ! A boon for CLI enthusiasts</title>
		<link>http://www.think-lamp.com/2008/10/awk-a-boon-for-cli-enthusiasts/</link>
		<comments>http://www.think-lamp.com/2008/10/awk-a-boon-for-cli-enthusiasts/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 18:09:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Lamp Fun]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[command line programming]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.think-lamp.com/?p=96</guid>
		<description><![CDATA[AWK is a general purpose programming language that is designed for processing text-based data, either in files or data streams, and was created at Bell Labs in the 1970s
I noticed that Erik Wendelin wrote an article “awk is a beautiful tool.” In this article he said that it was best to introduce Awk with practical [...]]]></description>
			<content:encoded><![CDATA[<p><strong>AWK</strong> is a general purpose <a title="Programming language" href="http://en.wikipedia.org/wiki/Programming_language">programming language</a> that is designed for processing text-based data, either in files or data streams, and was created at Bell Labs in the 1970s</p>
<p>I noticed that Erik Wendelin wrote an article “<a href="http://eriwen.com/tools/awk-is-a-beautiful-tool/">awk is a beautiful tool</a>.” In this article he said that it was best to introduce Awk with practical examples. I totally agree with Erik.</p>
<p>Eric Pement’s Awk one-liner collection consists of five sections:</p>
<ul>
<li>1. File spacing,</li>
<li>2. Numbering and calculations,</li>
<li>3. Text conversion and substitution,</li>
<li>4. Selective printing of certain lines,</li>
<li>5. Selective deleting of certain lines.</li>
</ul>
<p>The first part of the article will explain the first two sections: “File spacing” and “Numbering and calculations.” The second part will explain “Text conversion and substitution”, and the last part “Selective printing/deleting of certain lines.”<span id="more-96"></span></p>
<p>These one-liners work with all versions of awk, such as nawk (AT&amp;T’s new awk), gawk (GNU’s awk), mawk (Michael Brennan’s awk) and oawk (old awk).</p>
<p>Let’s start!</p>
<h2 style="margin-bottom: 10px;">1. Line Spacing</h2>
<p><strong>1. Double-space a file.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'1; { print &quot;&quot; }'</span>   filname.ext</pre></div></div>

<p>So how does it work? A one-liner is an Awk program and every Awk program consists of a sequence of pattern-action statements “<strong>pattern { action statements }</strong>“. In this case there are two statements &#8220;1&#8243; and &#8220;{ print &#8220;&#8221; }&#8221;. In a pattern-action statement either the pattern or the action may be missing. If the pattern is missing, the action is applied to every single line of input. A missing action is equivalent to &#8216;{ print }&#8217;. Thus, this one-liner translates to:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'1 { print } { print &quot;&quot; }'</span>   filname.ext</pre></div></div>

<p>An action is applied only if the pattern matches, i.e., pattern is true. Since &#8216;1&#8242; is always true, this one-liner translates further into two print statements:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print } { print &quot;&quot; }'</span>   filname.ext</pre></div></div>

<p>Every print statement in Awk is silently followed by an <strong>ORS &#8211; Output Record Separator</strong> variable, which is a newline by default. The first print statement with no arguments is equivalent to &#8220;print $0&#8243;, where $0 is a variable holding the entire line. The second print statement prints nothing, but knowing that each print statement is followed by ORS, it actually prints a newline. So there we have it, each line gets double-spaced.</p>
<p><strong>2. Another way to double-space a file.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'BEGIN { ORS=&quot;\n\n&quot; }; 1'</span>   filname.ext</pre></div></div>

<p><strong>BEGIN</strong> is a special kind of pattern which is not tested against the input. It is executed <strong>before</strong> any input is read. This one-liner double-spaces the file by setting the ORS variable to two newlines. As I mentioned previously, statement &#8220;1&#8243; gets translated to &#8220;{ print }&#8221;, and every print statement gets terminated with the value of ORS variable.</p>
<p><strong>3. Double-space a file so that no more than one blank line appears between lines of text.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'NF { print $0 &quot;\n&quot; }'</span>   filname.ext</pre></div></div>

<p>The one-liner uses another special variable called <strong>NF &#8211; Number of Fields</strong>. It contains the number of fields the current line was split into. For example, a line “this is a test” splits in four pieces and NF gets set to 4. The empty line “” does not split into any pieces and NF gets set to 0. Using NF as a pattern can effectively filter out empty lines. This one liner says: “If there are any number of fields, print the whole line followed by newline.”</p>
<p><strong>4. Triple-space a file.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'1; { print &quot;\n&quot; }'</span>   filname.ext</pre></div></div>

<p>This one-liner is very similar to previous ones. &#8216;1&#8242; gets translated into &#8216;{ print }&#8217; and the resulting Awk program is:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print; print &quot;\n&quot; }'</span>   filname.ext</pre></div></div>

<p>It prints the line, then prints a newline followed by terminating ORS, which is newline by default.</p>
<h2 style="margin-bottom: 10px;">2. Numbering and Calculations</h2>
<p><strong>5. Number lines in each file separately.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print FNR &quot;\t&quot; $0 }'</span>   filname.ext</pre></div></div>

<p>This Awk program appends the <strong>FNR &#8211; File Line Number</strong> predefined variable and a tab (\t) before each line. FNR variable contains the current line for each file separately. For example, if this one-liner was called on two files, one containing 10 lines, and the other 12, it would number lines in the first file from 1 to 10, and then resume numbering from one for the second file and number lines in this file from 1 to 12. FNR gets reset from file to file.</p>
<p><strong>6. Number lines for all files together.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print NR &quot;\t&quot; $0 }'</span>   filname.ext</pre></div></div>

<p>This one works the same as #5 except that it uses <strong>NR &#8211; Line Number</strong> variable, which does not get reset from file to file. It counts the input lines seen so far. For example, if it was called on the same two files with 10 and 12 lines, it would number the lines from 1 to 22 (10 + 12).</p>
<p><strong>7. Number lines in a fancy manner.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ printf(&quot;%5d : %s\n&quot;, NR, $0) }'</span>   filname.ext</pre></div></div>

<p>This one-liner uses <strong>printf</strong>() function to number lines in a custom format. It takes format parameter just like a regular printf() function. Note that ORS does not get appended at the end of printf(), so we have to print the newline (\n) character explicitly. This one right-aligns line numbers, followed by a space and a colon, and the line.</p>
<p><strong>8. Number only non-blank lines in files.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'NF { $0=++a &quot; :&quot; $0 }; { print }'</span>   filname.ext</pre></div></div>

<p>Awk <strong>variables are dynamic</strong>; they come into existence when they are first used. This one-liner pre-increments variable ‘a’ each time the line is non-empty, then it appends the value of this variable to the beginning of line and prints it out.</p>
<p><strong>9. Count lines in files (emulates wc -l).</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'END { print NR }'</span>   filname.ext</pre></div></div>

<p><strong>END</strong> is another special kind of pattern which is not tested against the input. It is executed when all the input has been exhausted. This one-liner outputs the value of NR special variable after all the input has been consumed. NR contains total number of lines seen (= number of lines in the file).</p>
<p><strong>10. Print the sum of fields in every line.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ s = 0; for (i = 1; i &amp;lt;= NF; i++) s = s+$i; print s }'</span>   filname.ext</pre></div></div>

<p>Awk has some features of C language, like the <strong>for (;;) { … }</strong> loop. This one-liner loops over all fields in a line (there are NF fields in a line), and adds the result in variable ’s’. Then it prints the result out and proceeds to the next line.</p>
<p><strong>11. Print the sum of fields in all lines.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ for (i = 1; i &amp;lt;= NF; i++) s = s+$i }; END { print s }'</span>   filname.ext</pre></div></div>

<p>This one-liner is basically the same as #10, except that it prints the sum of all fields. Notice how it did not initialize variable ’s’ to 0. It was not necessary as variables come into existence dynamically.</p>
<p><strong>12. Replace every field by its absolute value.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ for (i = 1; i &amp;lt;= NF; i++) if ($i &amp;lt; 0) $i = -$i; print }'</span>   filname.ext</pre></div></div>

<p>This one-liner uses two other features of C language, namely the <strong>if (…) { … }</strong> statement and omission of curly braces. It loops over all fields in a line and checks if any of the fields is less than 0. If any of the fields is less than 0, then it just negates the field to make it positive. Fields can be addresses indirectly by a variable. For example, i = 5; $i = &#8216;hello&#8217;, sets field number 5 to string &#8216;hello&#8217;.</p>
<p>Here is the same one-liner rewritten with curly braces for clarity. The &#8216;print&#8217; statement gets executed after all the fields in the line have been replaced by their absolute values.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{
  for (i = 1; i &amp;lt;= NF; i++) {
    if ($i &amp;lt; 0) {
      $i = -$i;
    }
  }
  print
}'</span>   filname.ext</pre></div></div>

<p><strong>13. Count the total number of fields (words) in a file.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ total = total + NF }; END { print total }'</span>   filname.ext</pre></div></div>

<p>This one-liner matches all the lines and keeps adding the number of fields in each line. The number of fields seen so far is kept in a variable named ‘total’. Once the input has been processed, special pattern &#8216;END { … }&#8217; is executed, which prints the total number of fields.</p>
<p><strong>14. Print the total number of lines containing word “Beth”.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'/Beth/ { n++ }; END { print n+0 }'</span>   filname.ext</pre></div></div>

<p>This one-liner has two pattern-action statements. The first one is &#8216;/Beth/ { n++ }&#8217;. A pattern between two slashes is a regular expression. It matches all lines containing pattern “Beth” (not necessarily the word “Beth”, it could as well be “Bethe” or “theBeth333″). When a line matches, variable ‘n’ gets incremented by one. The second pattern-action statement is &#8216;END { print n+0 }&#8217;. It is executed when the file has been processed. Note the &#8216;+0&#8242; in &#8216;print n+0&#8242; statement. It forces &#8216;0&#8242; to be printed in case there were no matches (’n’ was undefined). Had we not put &#8216;+0&#8242; there, an empty line would have been printed.</p>
<p><strong>15. Find the line containing the largest (numeric) first field.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'$1 &amp;gt; max { max=$1; maxline=$0 }; END { print max, maxline }'</span>   filname.ext</pre></div></div>

<p>This one-liner keeps track of the largest number in the first field (in variable ‘max’) and the corresponding line (in variable ‘maxline’). Once it has looped over all lines, it prints them out.</p>
<p><strong>16. Print the number of fields in each line, followed by the line.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print NF &quot;:&quot; $0 } '</span>   filname.ext</pre></div></div>

<p>This one-liner just prints out the predefined variable NF &#8211; Number of Fields, which contains the number of fields in the line, followed by a colon and the line itself.</p>
<p><strong>17. Print the last field of each line.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $NF }'</span>   filname.ext</pre></div></div>

<p>Fields in Awk need not be referenced by constants. For example, code like &#8216;f = 3; print $f&#8217; would print out the 3rd field. This one-liner prints the field with the value of NF. $NF is last field in the line.</p>
<p><strong>18. Print the last field of the last line.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ field = $NF }; END { print field }'</span>   filname.ext</pre></div></div>

<p>This one-liner keeps track of the last field in variable ‘field’. Once it has looped all the lines, variable ‘field’ contains the last field of the last line, and it just prints it out.</p>
<p><strong>19. Print every line with more than 4 fields.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'NF &amp;gt; 4'</span>   filname.ext</pre></div></div>

<p>This one-liner omits the action statement. As I noted in one-liner #1, a missing action statement is equivalent to &#8216;{ print }&#8217;.</p>
<p><strong>20. Print every line where the value of the last field is greater than 4.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'$NF &amp;gt; 4'</span>   filname.ext</pre></div></div>

<p>This one-liner is similar to #17. It references the last field by NF variable. If it’s greater than 4, it prints it out.</p>
<h2 style="margin-bottom: 10px;">Enjoy !!</h2>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.think-lamp.com%2F2008%2F10%2Fawk-a-boon-for-cli-enthusiasts%2F&amp;linkname=AWK%20%21%20A%20boon%20for%20CLI%20enthusiasts"><img src="http://www.think-lamp.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.think-lamp.com/2008/10/awk-a-boon-for-cli-enthusiasts/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
