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

<channel>
	<title>*nix Shell</title>
	<atom:link href="http://nixshell.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nixshell.wordpress.com</link>
	<description>UNIX / Linux Shell Hints and Tips&#160;&#160;&#160;&#160;&#160;&#160;(a http://steve-parker.org/sh/sh.shtml subproject)</description>
	<lastBuildDate>Wed, 04 Nov 2009 01:06:03 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='nixshell.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/9e458530f96756db742005af0b123d60?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>*nix Shell</title>
		<link>http://nixshell.wordpress.com</link>
	</image>
			<item>
		<title>Flushing Cache to Disk under Linux</title>
		<link>http://nixshell.wordpress.com/2009/11/04/flushing-cache-to-disk-under-linux/</link>
		<comments>http://nixshell.wordpress.com/2009/11/04/flushing-cache-to-disk-under-linux/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 01:06:03 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=121</guid>
		<description><![CDATA[There are lots of well-written articles, such as this [westnet.com] and especially this [kerneltrap] on Page Cacheing and pdflush, but RackerHacker (although the title says &#8220;reads&#8221;, it really seems to address lots of small writes) summarises it very well:
vm.dirty_ratio – The highest % of your memory that can be used to hold dirty data. If [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=121&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There are lots of well-written articles, such as <a href="http://www.westnet.com/~gsmith/content/linux-pdflush.htm">this</a> [westnet.com] and especially <a href="http://kerneltrap.org/node/3000">this</a> [kerneltrap] on Page Cacheing and pdflush, but <a href="http://rackerhacker.com/2008/08/07/reduce-disk-io-for-small-reads-using-memory/">RackerHacker</a> (although the title says &#8220;reads&#8221;, it really seems to address lots of small writes) summarises it very well:</p>
<blockquote><p><strong>vm.dirty_ratio</strong> – The highest % of your memory that can be used to hold dirty data. If you set this to a low value, the kernel will flush small writes to the disk more often. Higher values allow the small writes to stack up in memory. They’ll go to the disk in bigger chunks.</p>
<p><strong>vm.dirty_background_ratio</strong> – The lowest % of your memory where pdflush is told to stop when it is writing dirty data. You’ll want to keep this set as low as possible.</p></blockquote>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=121&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2009/11/04/flushing-cache-to-disk-under-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>find, locate, whereis, which, type</title>
		<link>http://nixshell.wordpress.com/2009/09/16/find-locate-whereis-which-type/</link>
		<comments>http://nixshell.wordpress.com/2009/09/16/find-locate-whereis-which-type/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 00:13:15 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=117</guid>
		<description><![CDATA[I suspect that most Linux admins know 3 or 4 of these five commands, and regularly use 2 or 3 of them.
linuxhaxor has a useful introduction to all five, with the most common uses for each of them.
Note that locate requires a regular run of updatedb &#8211; the article says that &#8220;The database is automatically [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=117&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I suspect that most Linux admins know 3 or 4 of these five commands, and regularly use 2 or 3 of them.</p>
<p><a href="http://www.linuxhaxor.net/2008/09/25/5-ways-to-search-for-files-using-the-terminal-in-linux/">linuxhaxor</a> has a useful introduction to all five, with the most common uses for each of them.</p>
<p>Note that <code>locate</code> requires a regular run of <code>updatedb</code> &#8211; the article says that &#8220;The database is automatically created and updated daily&#8221; which is true for most distributions, but it depends on your <code>cron</code> setup &#8211; you can update the locate db as frequently as you wish. Another thing to note about <code>locate</code> is that it will not use the (normally <code>root</code>-generated) database to tell you (as a non-privileged user) about files which you would not otherwise know about.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=117&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2009/09/16/find-locate-whereis-which-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>get the width of the terminal</title>
		<link>http://nixshell.wordpress.com/2009/09/08/get-the-width-of-the-terminal/</link>
		<comments>http://nixshell.wordpress.com/2009/09/08/get-the-width-of-the-terminal/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 15:43:32 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=112</guid>
		<description><![CDATA[A quick and easy way to get the width of your Linux terminal is the command <code>stty size</code><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=112&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A quick and easy way to get the width of your terminal is the command <code>stty size</code>. I have used it with <code>diff</code> like this:</p>
<blockquote><p>diff -y -W `stty size | cut -d&#8221; &#8221; -f2` &#8211;suppress-common-lines oldfile newfile</p></blockquote>
<p>Note: This stty option is not available on Solaris, however, if you have it installed, the /usr/openwin/bin/resize command sets the COLUMNS variable.</p>
<p><strong>update:</strong> This post originally said &#8220;width of your Linux terminal&#8221; but as noted in the comments, this feature of <code>stty</code> is also available in *BSD implementations, even though it is not part of the <code>POSIX</code> standard. So you should expect this to work on GNU and BSD systems (eg, most GNU/Linux distros, most *BSDs, including OSX) but not on all POSIX-compliant systems (eg, Solaris). I would assume that AIX, HPUX, SCO, the other &#8220;traditional&#8221; UNIX systems would also not support this, though I have not (yet) tested any of them. YMMV.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=112&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2009/09/08/get-the-width-of-the-terminal/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>tty, pts, and all of that&#8230;</title>
		<link>http://nixshell.wordpress.com/2009/07/19/109/</link>
		<comments>http://nixshell.wordpress.com/2009/07/19/109/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 00:03:57 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=109</guid>
		<description><![CDATA[The TTY Demystified tells you everything you need to know (and quite possibly more) about the *nix tty history. (If you do need to know more than this, you are probably already writing your own *nix kernel, or at least libc)
Hopefully that should give some insight into the terminfo, and other obscure details of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=109&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.linusakesson.net/programming/tty/index.php">The TTY Demystified</a> tells you everything you need to know (and quite possibly more) about the *nix tty history. (If you do need to know more than this, you are probably already writing your own *nix kernel, or at least libc)</p>
<p>Hopefully that should give some insight into the terminfo, and other obscure details of the *nix kernel and its obsession with piping characters from one place to another.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=109&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2009/07/19/109/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Command Directory</title>
		<link>http://nixshell.wordpress.com/2009/05/16/linux-command-directory/</link>
		<comments>http://nixshell.wordpress.com/2009/05/16/linux-command-directory/#comments</comments>
		<pubDate>Sat, 16 May 2009 00:39:13 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[MLP]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=107</guid>
		<description><![CDATA[I just found this page on the OReilly website &#8211; a Linux Command Directory
Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.
It doesn&#8217;t cover everything (what could?) but it could [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=107&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I just found this page on the OReilly website &#8211; a <a href="http://oreilly.com/linux/command-directory/">Linux Command Directory</a></p>
<blockquote><p>Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.</p></blockquote>
<p>It doesn&#8217;t cover everything (what could?) but it could be a useful page to bookmark.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=107&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2009/05/16/linux-command-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>awk one-liners</title>
		<link>http://nixshell.wordpress.com/2009/04/01/awk-one-liners/</link>
		<comments>http://nixshell.wordpress.com/2009/04/01/awk-one-liners/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 22:05:31 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[MLP]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=98</guid>
		<description><![CDATA[I have previously plugged the great list of sed 1-liners at http://sed.sourceforge.net/sed1line.txt.
Here is a similar (if shorter) list of handy awk 1-liners:
http://www.sap-basis-abap.com/unix/awk-one-liner-tips.htm:
Print column1, column5 and column7 of a data file or output of any columns list
awk '{print $1, $5, $7}' data_file
cat file_name &#124;awk '{print $1 $5 $7}'
ls –al &#124;awk '{print $1, $5, $7}' -- Prints [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=98&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have previously plugged the great list of sed 1-liners at <a href="http://sed.sourceforge.net/sed1line.txt">http://sed.sourceforge.net/sed1line.txt</a>.</p>
<p>Here is a similar (if shorter) list of handy awk 1-liners:</p>
<p><a href="http://www.sap-basis-abap.com/unix/awk-one-liner-tips.htm">http://www.sap-basis-abap.com/unix/awk-one-liner-tips.htm</a>:</p>
<p><strong>Print column1, column5 and column7 of a data file or output of any columns list</strong></p>
<p><code>awk '{print $1, $5, $7}' data_file</p>
<p>cat file_name |awk '{print $1 $5 $7}'</p>
<p>ls –al |awk '{print $1, $5, $7}' -- Prints file_permissions,size and date<br />
</code><br />
<strong>List all files names whose file size greater than zero.</strong></p>
<p><code>ls –al |awk '$5 &gt; 0 {print $9}'<br />
</code><br />
<strong>List all files whose file size equal to 512bytes.<br />
</strong><br />
<code>ls –al |awk '$5 == 0 {print $9}'</code></p>
<p><strong>print all lines</strong></p>
<p><code>awk '{print }' file_name</p>
<p>awk '{print 0}' file_name</code><br />
<strong><br />
Number of lines in a file</strong><br />
<code><br />
awk ' END {print NR}' file_name<br />
</code><br />
<strong>Number of columns in each row of a file<br />
</strong><br />
<code>awk '{print NF}' file_name<br />
</code><br />
<strong>Sort the output of file and eliminate duplicate rows<br />
</strong><br />
<code>awk '{print $1, $5, $7}' |sort –u<br />
</code><br />
<strong>List all file names whose file size is greater than 512bytes and owner is &#8220;oracle&#8221;<br />
</strong><br />
<code>ls –al |awk '$3 == "oracle" &amp;&amp; $5 &gt; 512 {print $9}'<br />
</code><br />
<strong>List all file names whose owner could be either &#8220;oracle&#8221; or &#8220;root&#8221;<br />
</strong><br />
<code>ls –al |awk '$3 == "oracle" || $3 == "root" {print $9}'<br />
</code><br />
<strong>list all the files whose owner is not &#8220;oracle<br />
</strong><br />
<code>ls –al |awk '$3 != "oracle" {print $9}'<br />
</code><br />
<strong>List all lines which has at least one or more characters<br />
</strong><br />
<code>awk 'NF &gt; 0 {print }' file_name<br />
</code><br />
<strong>List all lines longer that 50 characters<br />
</strong><br />
<code>awk 'length($0) &gt; 50 {print }' file_name<br />
</code><br />
<strong>List first two columns<br />
</strong><br />
<code>awk '{print $1, $2}' file_name<br />
</code><br />
<strong>Swap first two columns of a file and print<br />
</strong><br />
<code>awk '{temp = $1; $1 = $2; $2 = temp; print }' file_name<br />
</code><br />
<strong>Replace first column as &#8220;ORACLE&#8221; in a data file<br />
</strong><br />
<code>awk '{$1 = "ORACLE"; print }' data_file<br />
</code><br />
<strong>Remove first column values in a data file<br />
</strong><br />
<code>awk '{$1 =""; print }' data_file<br />
</code><br />
<strong>Calculate total size of a directory in Mb<br />
</strong><code><br />
ls –al |awk '{total +=$5};END {print "Total size: " total/1024/1024 " Mb"}'<br />
</code><strong><br />
Calculate total size of a directory including sub directories in Mb<br />
</strong><code><br />
ls –lR |awk '{total +=$5};END {print "Total size: " total/1024/1024 " Mb"}'</code><br />
<strong><br />
Find largest file in a directory including sub directories<br />
</strong><br />
<code>ls –lR |awk '{print $5 "\t" $9}' |sort –n |tail -1 </code></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=98&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2009/04/01/awk-one-liners/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Saving, Escaping, and Restoring positional parameters in a POSIX shell</title>
		<link>http://nixshell.wordpress.com/2009/03/21/saving-escaping-and-restoring-positional-parameters-in-a-posix-shell/</link>
		<comments>http://nixshell.wordpress.com/2009/03/21/saving-escaping-and-restoring-positional-parameters-in-a-posix-shell/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 23:44:35 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=94</guid>
		<description><![CDATA[http://www.seanius.net/blog/2009/03/saving-and-restoring-positional-params/ has a really good post about how &#8220;shift&#8221; loses the original command-line arguments, discusses various seemingly-obvious ways of restoring them, explores why they fail for certain types of input, and provides what seems to be a working solution:
one way you could try to store/save them would be to save the original copy of $@ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=94&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.seanius.net/blog/2009/03/saving-and-restoring-positional-params/">http://www.seanius.net/blog/2009/03/saving-and-restoring-positional-params/</a> has a really good post about how &#8220;shift&#8221; loses the original command-line arguments, discusses various seemingly-obvious ways of restoring them, explores why they fail for certain types of input, and provides what seems to be a working solution:</p>
<blockquote><p>one way you could try to store/save them would be to save the original copy of $@ and use eval set &#8212; later on to change it back to the saved variable</p></blockquote>
<p>&#8230; but as it turns out, that doesn&#8217;t work with spaces, or quotes. Excellent, really concise description of the problem(s) and solution(s).</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=94&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2009/03/21/saving-escaping-and-restoring-positional-parameters-in-a-posix-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Using GNU Grep for Fun and Profit!</title>
		<link>http://nixshell.wordpress.com/2009/02/11/using-gnu-grep-for-fun-and-profit/</link>
		<comments>http://nixshell.wordpress.com/2009/02/11/using-gnu-grep-for-fun-and-profit/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 02:03:42 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=91</guid>
		<description><![CDATA[Shell Script: GetCluster &#8211; a shell script I happen to have written today; uses a few features of GNU Grep, whilst being tolerant of non-GNU greps (at the cost of some functionality).
This simple shell script is an example of the kind of thing that can easily be done with a few simple commands. As it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=91&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://steve-parker.org/urandom/comment.php?art=693">Shell Script: GetCluster</a> &#8211; a shell script I happen to have written today; uses a few features of GNU Grep, whilst being tolerant of non-GNU greps (at the cost of some functionality).</p>
<p>This simple shell script is an example of the kind of thing that can easily be done with a few simple commands. As it is intended for the Solaris platform, which does not necessarily include GNU&#8217;s grep, some additional complexity is required to see what the platform&#8217;s grep utility is capable of.</p>
<p>This is achieved by:<br />
1) Set the PATH to pick up the GNU tools first: <code>PATH=/usr/sfw/bin:$PATH</code><br />
2) Find grep (ggrep if possible; the existence of ggrep suggests that grep itself is not GNU&#8217;s grep):<br />
<code>type ggrep &gt;/dev/null 2&gt;&amp;1<br />
if [ "$?" -eq "0" ]; then<br />
  GREP=`which ggrep`<br />
else<br />
  GREP=`which grep`<br />
fi<br />
</code></p>
<p>It then finds a file, which could be in one of many places:<br />
<code>CLUSTERTOC=`ls clustertoc .clustertoc /cdrom/cdrom0/Solaris*/Product/.clustertoc /cdrom/Solaris*/Product/.clustertoc /mnt/Solaris*/Product/.clustertoc 2&gt;/dev/null|head -1`</code><br />
What this does, is identify the first succesful match (the rest go to /dev/null). If none is found, the CLUSTERTOC will not be a valid file (note: this gets us the added bonus that it will complain if clustertoc is a device driver, pipe, etc).</p>
<p>It then looks for &#8220;SUNW_CSRMEMBER&#8221; in the clustertoc, using &#8220;<code>grep -n</code>&#8221; to get the line number, then passing that linenumber on to <code>head</code> so as to limit the output to only contain those lines. Any lines below that point would refer to other clusters, and be irrelevant. We want to get the last of the relevant part of the file, so that the <code>tail</code> command below will give us what we need.</p>
<p>GNU Grep has a &#8220;-A n&#8221; and &#8220;-B n&#8221; facility to say &#8220;include n lines After the matching line&#8221; or &#8220;include n lines Before the matching line&#8221;. We use &#8220;-A&#8221; here to get the following lines which describe the pacakge in more detail:<br />
<code>   head -${linenum} $CLUSTERTOC |$GREP -A4 "^CLUSTER="|cut -d"=" -f2-|tail -4</code></p>
<p>See the <a href="http://steve-parker.org/code/sh/getcluster/readme.txt">readme</a> file for specific output &#8211; the Solaris (non-GNU) version has notably less detail than the GNU version. </p>
<p>Hopefully the script (<a href="http://steve-parker.org/code/sh/getcluster/getcluster.sh">http://steve-parker.org/code/sh/getcluster/getcluster.sh</a>) is in other ways sufficiently self-explanatory.</p>
<p>The input file (<a href="http://steve-parker.org/code/sh/getcluster/clustertoc">http://steve-parker.org/code/sh/getcluster/clustertoc</a> is relatively simple, and should explain any other queries.</p>
<p>Still &#8211; this simple script may provoke a few questions; please do play with it and ask away, if anything is unclear. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=91&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2009/02/11/using-gnu-grep-for-fun-and-profit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Happy Second Birthday!</title>
		<link>http://nixshell.wordpress.com/2009/01/21/happy-second-birthday/</link>
		<comments>http://nixshell.wordpress.com/2009/01/21/happy-second-birthday/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 01:41:07 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=85</guid>
		<description><![CDATA[I have missed the second birthday of this blog; starting with Hello World on 17th January 2007, this blog has seen a small growth, but the comments posted show that people have found it to be useful, which is good.
I hope that you continue to find it useful; I really will try to post a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=85&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have missed the second birthday of this blog; starting with <a href="http://nixshell.wordpress.com/2007/01/17/hello-world/">Hello World</a> on 17th January 2007, this blog has seen a small growth, but the comments posted show that people have found it to be useful, which is good.</p>
<div id="attachment_87" class="wp-caption aligncenter" style="width: 310px"><img src="http://nixshell.files.wordpress.com/2009/01/traffic.gif?w=300&#038;h=150" alt="Traffic" title="traffic" width="300" height="150" class="size-medium wp-image-87" /><p class="wp-caption-text">Traffic</p></div>
<div id="attachment_86" class="wp-caption aligncenter" style="width: 310px"><img src="http://nixshell.files.wordpress.com/2009/01/stats.gif?w=300&#038;h=242" alt="Statistics" title="stats" width="300" height="242" class="size-medium wp-image-86" /><p class="wp-caption-text">Statistics</p></div>
<p>I hope that you continue to find it useful; I really will try to post a bit more often in 2009!</p>
<p>Steve</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=85&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2009/01/21/happy-second-birthday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>

		<media:content url="http://nixshell.files.wordpress.com/2009/01/traffic.gif?w=300" medium="image">
			<media:title type="html">traffic</media:title>
		</media:content>

		<media:content url="http://nixshell.files.wordpress.com/2009/01/stats.gif?w=300" medium="image">
			<media:title type="html">stats</media:title>
		</media:content>
	</item>
		<item>
		<title>A very happy Christmas to all readers</title>
		<link>http://nixshell.wordpress.com/2008/12/24/a-very-happy-christmas-to-all-readers/</link>
		<comments>http://nixshell.wordpress.com/2008/12/24/a-very-happy-christmas-to-all-readers/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 22:14:38 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=82</guid>
		<description><![CDATA[echo unccl puevfgznf &#124; tr A-Za-z N-ZA-Mn-za-m
This is a very simplistic thing called &#8220;rot13&#8243;, whereby &#8220;a&#8221; becomes &#8220;n&#8221;, &#8220;b&#8221; becomes &#8220;o&#8221;, &#8220;c&#8221; becomes &#8220;p&#8221;, and so on. The tr utility is ideal for simple string manipulation like this.
Happy Christmas to all!
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=82&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><code>echo unccl puevfgznf | tr A-Za-z N-ZA-Mn-za-m</code></p>
<p>This is a very simplistic thing called &#8220;rot13&#8243;, whereby &#8220;a&#8221; becomes &#8220;n&#8221;, &#8220;b&#8221; becomes &#8220;o&#8221;, &#8220;c&#8221; becomes &#8220;p&#8221;, and so on. The <code>tr</code> utility is ideal for simple string manipulation like this.</p>
<p>Happy Christmas to all!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=82&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2008/12/24/a-very-happy-christmas-to-all-readers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>ssh port forwarding without starting a new session</title>
		<link>http://nixshell.wordpress.com/2008/12/10/ssh-port-forwarding-without-starting-a-new-session/</link>
		<comments>http://nixshell.wordpress.com/2008/12/10/ssh-port-forwarding-without-starting-a-new-session/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 16:53:56 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[MLP]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=79</guid>
		<description><![CDATA[You can forward ports with ssh like this:
$ ssh -L 8080:localhost:80 user@remotehost
This will log you in to remotehost as user, and port 8080 on your local machine will be tunnelled to port 80 on remotehost. If remotehost can see a machine that you can&#8217;t (for example, if it&#8217;s on an internal network), you can even [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=79&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>You can forward ports with ssh like this:</p>
<p><code>$ <strong>ssh -L 8080:localhost:80 user@remotehost</strong></code></p>
<p>This will log you in to <code>remotehost</code> as <code>user</code>, and port <code>8080</code> on your local machine will be tunnelled to port <code>80</code> on <code>remotehost</code>. If remotehost can see a machine that you can&#8217;t (for example, if it&#8217;s on an internal network), you can even do this:</p>
<p><code>$ <strong>ssh -L 8080:internalhost:80 user@borderhost</strong></code></p>
<p>This will log you in to <code>borderhost</code>, and <code>localhost:8080</code> will be directed to <code>internalhost:80</code>, even though you may not be able to see <code>internalhost</code> directly yourself.</p>
<p>What I didn&#8217;t know until I read <a href="http://nion.modprobe.de/blog/archives/656-ssh-on-the-fly-port-forwarding.html">Nico Golde&#8217;s blog today</a>, is that you can do this interactively, with an existing session. Tilde (~) is the default escape character, and ~C (note that&#8217;s an uppercase C) gets you a shell session within ssh itself:</p>
<p><code>$ <strong>ssh user@remotehost</strong><br />
user@remotehost$ <strong>~C</strong><br />
ssh&gt; <strong>-L 8080:localhost:80</strong><br />
Forwarding port.<br />
user@remotehost$ </code></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=79&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2008/12/10/ssh-port-forwarding-without-starting-a-new-session/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Emptying deleted files</title>
		<link>http://nixshell.wordpress.com/2008/11/08/emptying-deleted-files/</link>
		<comments>http://nixshell.wordpress.com/2008/11/08/emptying-deleted-files/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 00:07:40 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[MLP]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=77</guid>
		<description><![CDATA[Mike Hommey has a nice article on clearing down deleted (but still-open) files:
http://glandium.org/blog/?p=211. He explains the problem clearly, and goes on to provide the solution, too. Well worth bookmarking, for that 2am emergency!
someone had to free some space on a 1GB filesystem, and thought a good idea would be to delete that 860MB log file [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=77&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Mike Hommey has a nice article on clearing down deleted (but still-open) files:<br />
<a href="http://glandium.org/blog/?p=211">http://glandium.org/blog/?p=211</a>. He explains the problem clearly, and goes on to provide the solution, too. Well worth bookmarking, for that 2am emergency!</p>
<blockquote><p>someone had to free some space on a 1GB filesystem, and thought a good idea would be to delete that 860MB log file that nobody cares about. Except that it didn’t really remove it, but he didn’t really check.</p>
<p>Later, the “filesystem full” problem came back at someone else, who came to ask me what files from a small list he could remove. But the files were pretty small, and that wouldn’t have freed enough space. That gave me the feeling that we probably were in this typical case I introduced this post with, which du -sk confirmed: 970MB used on the filesystem according to df, but only 110MB worth of data…</p></blockquote>
<p>Mike has solutions to this for Solaris and Linux; <code>lsof</code> is also useful for this kind of thing, on systems which have it.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=77&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2008/11/08/emptying-deleted-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>more (or less) vi</title>
		<link>http://nixshell.wordpress.com/2008/10/17/more-or-less-vi/</link>
		<comments>http://nixshell.wordpress.com/2008/10/17/more-or-less-vi/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 00:32:12 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=75</guid>
		<description><![CDATA[When using the more tool (this works with less, also, and less is generally more useful; you can scroll backwards and forwards with less), you can press &#8220;v&#8221; to start editing the file, in vi, at the line you are currently viewing.
This works on Linux and Solaris; please confirm on other OSes as appropriate, though [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=75&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When using the <code>more</code> tool (this works with <code>less</code>, also, and <code>less</code> is generally more useful; you can scroll backwards and forwards with <code>less</code>), you can press &#8220;<code>v</code>&#8221; to start editing the file, in <code>vi</code>, at the line you are currently viewing.</p>
<p>This works on Linux and Solaris; please confirm on other OSes as appropriate, though I would assume that what works on <code>more</code> on Solaris, will work on <code>more</code> or <code>less</code> on just about any OS.</p>
<p>This makes using <code>more</code> or <code>less</code> far more powerful than before, and a new way into <code>vi</code>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=75&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2008/10/17/more-or-less-vi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>chmod syntax&#8230; be careful!</title>
		<link>http://nixshell.wordpress.com/2008/09/09/chmod-syntax-be-careful/</link>
		<comments>http://nixshell.wordpress.com/2008/09/09/chmod-syntax-be-careful/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 23:05:36 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=73</guid>
		<description><![CDATA[Ben Hutchings has noted a quirk in the chmod syntax: If you use the &#8220;chmod o-x&#8221; syntax, but omit the &#8220;o&#8221; (Others) (or the &#8220;u&#8221; (User) or &#8220;g&#8221; (Group)), it will default to &#8220;a&#8221; (All).
So &#8220;chmod -x foo&#8221; becomes &#8220;chmod a-x foo&#8220;; similarly, &#8220;chmod +x foo&#8221; becomes &#8220;chmod a+x foo&#8220;
      [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=73&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Ben Hutchings has noted a <a href="http://womble.decadent.org.uk/blog/chmod--x-considered-harmful">quirk in the chmod syntax</a>: If you use the &#8220;<code>chmod o-x</code>&#8221; syntax, but omit the &#8220;<code>o</code>&#8221; (Others) (or the &#8220;<code>u</code>&#8221; (User) or &#8220;<code>g</code>&#8221; (Group)), it will default to &#8220;<code>a</code>&#8221; (All).</p>
<p>So &#8220;<code>chmod -x foo</code>&#8221; becomes &#8220;<code>chmod a-x foo</code>&#8220;; similarly, &#8220;<code>chmod +x foo</code>&#8221; becomes &#8220;<code>chmod a+x foo</code>&#8220;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nixshell.wordpress.com/73/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nixshell.wordpress.com/73/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=73&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2008/09/09/chmod-syntax-be-careful/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Bash History</title>
		<link>http://nixshell.wordpress.com/2008/09/01/bash-history/</link>
		<comments>http://nixshell.wordpress.com/2008/09/01/bash-history/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 23:32:03 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[unix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MLP]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=71</guid>
		<description><![CDATA[Interesting list of 15 examples of bash history syntax.
Most people probably know #5:
# !ps
ps aux &#124; grep yp
I didn&#8217;t know #13, that looks really useful for arcane purposes:
# cp ~/longname.txt /really/a/very/long/path/long-filename.txt
# ls -l !cp:2
ls -l /really/a/very/long/path/long-filename.txt
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=71&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Interesting list of <a href="http://www.thegeekstuff.com/2008/08/15-examples-to-master-linux-command-line-history/">15 examples of bash history syntax</a>.</p>
<p>Most people probably know #5:<br />
<code># <b>!ps</b><br />
ps aux | grep yp</code></p>
<p>I didn&#8217;t know #13, that looks really useful for arcane purposes:<br />
<code># <b>cp ~/longname.txt /really/a/very/long/path/long-filename.txt</b><br />
# <b>ls -l !cp:2</b><br />
ls -l /really/a/very/long/path/long-filename.txt</code></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nixshell.wordpress.com/71/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nixshell.wordpress.com/71/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=71&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2008/09/01/bash-history/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Some useful Linux / *nix admin words of experience</title>
		<link>http://nixshell.wordpress.com/2008/08/21/some-useful-linux-nix-admin-words-of-experience/</link>
		<comments>http://nixshell.wordpress.com/2008/08/21/some-useful-linux-nix-admin-words-of-experience/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 00:54:18 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[MLP]]></category>
		<category><![CDATA[regexp]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=68</guid>
		<description><![CDATA[Entitled &#8220;Lazy Linux: 10 essential tricks for admins&#8220;, this is a pretty good set of essential commands for *nix administrators.
If I have to suggest anything for in-depth study, it&#8217;s &#8220;Trick 6&#8243;: &#8220;Remote VNC session through an SSH tunnel&#8221;, because you can actually do just about anything through an SSH tunnel. If you&#8217;re faced with you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=68&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Entitled &#8220;<a href="http://www.ibm.com/developerworks/linux/library/l-10sysadtips/index.html">Lazy Linux: 10 essential tricks for admins</a>&#8220;, this is a pretty good set of essential commands for *nix administrators.</p>
<p>If I have to suggest anything for in-depth study, it&#8217;s &#8220;Trick 6&#8243;: &#8220;Remote VNC session through an SSH tunnel&#8221;, because you can actually do just about anything through an SSH tunnel. If you&#8217;re faced with you -&gt; firewall -&gt; internet -&gt; remotemachine -&gt; internet -&gt; restoftheworld, you can do whatever you like with &#8220;restof theworld&#8221; if you can ssh to &#8220;remotemachine&#8221;, whatever the local firewall thinks. And you can probably ssh over port 443 through the firewall. Hmm; maybe I should write this up properly at some point. I&#8217;m sure it&#8217;s well documented on the web if you look for it&#8230;.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nixshell.wordpress.com/68/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nixshell.wordpress.com/68/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=68&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2008/08/21/some-useful-linux-nix-admin-words-of-experience/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Bash Quiz</title>
		<link>http://nixshell.wordpress.com/2008/06/09/bash-quiz/</link>
		<comments>http://nixshell.wordpress.com/2008/06/09/bash-quiz/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 22:26:24 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[quiz]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=67</guid>
		<description><![CDATA[Network Theory have a Bash Quiz!
Out of the ten questions, one I&#8217;m not immediately sure of without checking; another I only happened to come across earlier today, and one (echo "\'")I got wrong  
So, 7/10 really; 8/10 by good fortune of coming across the definition earlier today
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=67&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Network Theory have a <a href="http://www.network-theory.co.uk/articles/bash-quiz.html">Bash Quiz</a>!</p>
<p>Out of the ten questions, one I&#8217;m not immediately sure of without checking; another I only happened to come across earlier today, and one (<code>echo "\'"</code>)I got wrong <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>So, 7/10 really; 8/10 by good fortune of coming across the definition earlier today</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nixshell.wordpress.com/67/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nixshell.wordpress.com/67/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=67&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2008/06/09/bash-quiz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Book</title>
		<link>http://nixshell.wordpress.com/2008/04/23/book/</link>
		<comments>http://nixshell.wordpress.com/2008/04/23/book/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 00:35:25 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[MLP]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[init]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pipes]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/?p=66</guid>
		<description><![CDATA[A serious publisher has contacted me about writing a serious book about Linux shell programming.
It is all really very serious. I&#8217;m not used to being serious, as you can probably tell from the fact that I have now used the word &#8220;serious&#8221; four times in this three-sentence post.
I am rather keen to write a book [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=66&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A serious publisher has contacted me about writing a serious book about Linux shell programming.</p>
<p>It is all really very serious. I&#8217;m not used to being serious, as you can probably tell from the fact that I have now used the word &#8220;serious&#8221; four times in this three-sentence post.</p>
<p>I am rather keen to write a book on the subject, not because I&#8217;m vain, or desperate for money, but because the stuff I have seen out there in dead-tree format has been of rather low quality. Also because of all the emails I&#8217;ve received over the years, they have all been positive, and none has said anything along the lines of &#8220;I didn&#8217;t need any of that because I bought Book[X]&#8220;, or indeed any book.    People have emailed me, asking for advice as to what book to buy, and I have been unable to recommend any book that I have seen.</p>
<p>So:<br />
<strong><i><br />
What would you like to see in your ideal book about UNIX / Linux shell scripting, be it Bourne, Bash, ksh, tcsh, zsh, whatever?</i></strong></p>
<p>Please don&#8217;t be timid; if you want to know how to work out how many nose-flutes can be fitted into the area of a Boeing 757, you won&#8217;t be anything like as strange as some of the correspondants I&#8217;ve had over the years, so please, tell me what is bugging you, what has bugged you, or even what you think might be likely to bug you in days / months / years to come.</p>
<p>I&#8217;m likely to answer any specific questions here and now, whether or not they end up in the book, but anything you&#8217;d like to see in a book, too&#8230; post that here, and I&#8217;ll have a stab at it.</p>
<p>Also, I would of course be interested to know if you have found any useful books on or around the subject, and what they did particularly well.</p>
<p>Steve</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nixshell.wordpress.com/66/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nixshell.wordpress.com/66/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=66&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2008/04/23/book/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Happy First Birthday!</title>
		<link>http://nixshell.wordpress.com/2008/01/06/happy-first-birthday/</link>
		<comments>http://nixshell.wordpress.com/2008/01/06/happy-first-birthday/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 02:28:24 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[MLP]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[init]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pipes]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/2008/01/06/happy-first-birthday/</guid>
		<description><![CDATA[This blog has now been running for a year; the first post was Hello World on 17th Jan 2007.
I hadn&#8217;t realised it had been going for so long; in that time, I&#8217;ve made 41 posts, so I haven&#8217;t quite managed to make one post per week     I have been a bit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=65&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This blog has now been running for a year; the first post was <a href="http://nixshell.wordpress.com/2007/01/17/hello-world/">Hello World</a> on 17th Jan 2007.</p>
<p>I hadn&#8217;t realised it had been going for so long; in that time, I&#8217;ve made 41 posts, so I haven&#8217;t quite managed to make one post per week <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />    I have been a bit slack lately, for which I do apologise. New Years Resolution: I must make more posts here!</p>
<p>In the meantime, my main site, <a href="http://steve-parker.org/">steve-parker.org</a>, has celebrated its seventh birthday, having been born in June 2000 &#8211; looking forward to making the 8th birthday celebrations this June!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nixshell.wordpress.com/65/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nixshell.wordpress.com/65/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=65&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2008/01/06/happy-first-birthday/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Ordering items</title>
		<link>http://nixshell.wordpress.com/2007/11/07/ordering-items/</link>
		<comments>http://nixshell.wordpress.com/2007/11/07/ordering-items/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 22:49:57 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/2007/11/07/ordering-items/</guid>
		<description><![CDATA[There are lots of small little quirks to the *nix shells; this is just one of them.
If you want to list the files in a directory, then ls will list them all for you, in alphabetical order.
If you want to list them by size, you can use ls -S; by timestamp: ls -t, and so [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=64&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There are lots of small little quirks to the *nix shells; this is just one of them.</p>
<p>If you want to list the files in a directory, then <code>ls</code> will list them all for you, in alphabetical order.</p>
<p>If you want to list them by size, you can use <code>ls -S</code>; by timestamp: <code>ls -t</code>, and so on.</p>
<p>But <code>ls</code> is a particular utility. What happens when we do this:</p>
<p><code><br />
for myfile in *<br />
do<br />
&nbsp;&nbsp;echo "My file is called $myfile"<br />
done</code></p>
<p>We get an alphabetically sorted list (see <code>man ascii</code> for the actual detail; they&#8217;re sorted by ASCII value, so numbers first, then uppercase letters, then lowercase letters).</p>
<p>This can be a pain, but it can also be quite useful. If you&#8217;ve got a bunch of files:</p>
<p><code>1.install.txt<br />
2.setup.txt<br />
3.use.txt<br />
4.uninstall.txt</code></p>
<p>Then you can play with them in order, just by using the asterisk:</p>
<p><code>for i in *<br />
do<br />
&nbsp;&nbsp;echo "File $i" &gt;&gt; all.txt<br />
&nbsp;&nbsp;cat $i &gt;&gt; all.txt<br />
done</code></p>
<p>And it will sort them into order for you (&#8220;1&#8243; comes before &#8220;2&#8243; in ASCII, and so on&#8230;)</p>
<p>Or you could just do this:</p>
<p><code>more * &gt; all.txt</code></p>
<p>Because <code>more</code> will prefix each file with its name in a header, if there is more than one file to process.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nixshell.wordpress.com/64/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nixshell.wordpress.com/64/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=64&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2007/11/07/ordering-items/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Maths in bash shell</title>
		<link>http://nixshell.wordpress.com/2007/09/28/maths-in-bash-shell/</link>
		<comments>http://nixshell.wordpress.com/2007/09/28/maths-in-bash-shell/#comments</comments>
		<pubDate>Fri, 28 Sep 2007 08:53:04 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/2007/09/28/maths-in-bash-shell/</guid>
		<description><![CDATA[http://snap.nlc.dcccd.edu/reference/bash1/features_29.html has a bash-specific technique for processing calculations:

$[ expression ]
$(( expression ))

See the link for further details.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=63&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://snap.nlc.dcccd.edu/reference/bash1/features_29.html">http://snap.nlc.dcccd.edu/reference/bash1/features_29.html</a> has a bash-specific technique for processing calculations:</p>
<pre>
$[ expression ]
$(( expression ))
</pre>
<p>See the link for further details.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nixshell.wordpress.com/63/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nixshell.wordpress.com/63/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=63&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2007/09/28/maths-in-bash-shell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>IFS &#8211; Internal Field Separator</title>
		<link>http://nixshell.wordpress.com/2007/09/26/ifs-internal-field-separator/</link>
		<comments>http://nixshell.wordpress.com/2007/09/26/ifs-internal-field-separator/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 00:41:09 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/2007/09/26/ifs-internal-field-separator/</guid>
		<description><![CDATA[It seems like an esoteric concept, but it&#8217;s actually very useful.
If your input file is &#8220;1 apple steve@example.com&#8221;, then your script could say:
while read qty product customer
do
  echo "${customer} wants ${qty} ${product}(s)"
done
The read command will read in the three variables, because they&#8217;re spaced out from each other.
However, critical data is often presented in spreadsheet [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=62&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It seems like an esoteric concept, but it&#8217;s actually very useful.</p>
<p>If your input file is &#8220;1 apple steve@example.com&#8221;, then your script could say:</p>
<pre>while read qty product customer
do
  echo "${customer} wants ${qty} ${product}(s)"
done</pre>
<p>The <code>read</code> command will read in the three variables, because they&#8217;re spaced out from each other.</p>
<p>However, critical data is often presented in spreadsheet format. If you save these as CSV files, it will come out like this:</p>
<pre>1,apple,steve@example.com</pre>
<p>This contains no spaces, and the above code will not be able to understand it. It will take the whole thing as one item &#8211; the first thing, quanity, <code>$qty</code>, and set the other two fields as blank.</p>
<p>The way around this, is to tell the entire shell, that &#8220;,&#8221; (the comma itself) separates fields; it&#8217;s the &#8220;internal field separator&#8221;, or IFS.</p>
<p>The IFS variable is set to space/tab/newline, which isn&#8217;t easy to set in the shell, so it&#8217;s best to save the original IFS to another variable, so you can put it back again after you&#8217;ve messed around with it. I tend to use &#8220;<code>oIFS=$IFS</code>&#8221; to save the current value into &#8220;oIFS&#8221;.</p>
<p>Also, when the IFS variable is set to something other than the default, it can really mess with other code.</p>
<p>Here&#8217;s a script I wrote today to parse a CSV file:</p>
<pre>
#!/bin/sh
oIFS=$IFS     # Always keep the original IFS!
IFS=","          # Now set it to what we want the "read" loop to use
while read qty product customer
do
  IFS=$oIFS
  # process the information
  IFS=","       # Put it back to the comma, for the loop to go around again
done &lt; myfile.txt</pre>
<p>It really is that easy, and it&#8217;s very versatile. You do have to be careful to keep a copy of the original (I always use the name oIFS, but whatever suits you), and to put it back as soon as possible, because so many things invisibly use the IFS &#8211; grep, cut, you name it. It&#8217;s surprising how many things within the &#8220;<code>while read</code>&#8221; loop actually did depend on the IFS being the default value.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nixshell.wordpress.com/62/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nixshell.wordpress.com/62/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=62&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2007/09/26/ifs-internal-field-separator/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>Logic</title>
		<link>http://nixshell.wordpress.com/2007/09/07/logic/</link>
		<comments>http://nixshell.wordpress.com/2007/09/07/logic/#comments</comments>
		<pubDate>Fri, 07 Sep 2007 01:00:06 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[MLP]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/2007/09/07/logic/</guid>
		<description><![CDATA[Whilst not directly related to shell programming, understanding of basic logic operations &#8211; AND, OR, NOR, XOR, NAND, etc, are as important to shell programmers as to C, Java, .Net and other coders.
My recent interactive logic gate page seems to have become quite popular; it&#8217;s just a simple implementation of each of the major logic [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=61&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Whilst not directly related to shell programming, understanding of basic logic operations &#8211; AND, OR, NOR, XOR, NAND, etc, are as important to shell programmers as to C, Java, .Net and other coders.</p>
<p>My recent <a href="http://steve-parker.org/logic/">interactive logic gate</a> page seems to have become quite popular; it&#8217;s just a simple implementation of each of the major logic circuits in use. If you want to see more, say so &#8211; I&#8217;ll add anything you ask for <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nixshell.wordpress.com/61/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nixshell.wordpress.com/61/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=61&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2007/09/07/logic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>25 useful commands in Linux/UNIX for Beginners</title>
		<link>http://nixshell.wordpress.com/2007/08/22/25-useful-commands-in-linuxunix-for-beginners/</link>
		<comments>http://nixshell.wordpress.com/2007/08/22/25-useful-commands-in-linuxunix-for-beginners/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 01:04:03 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[MLP]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/2007/08/22/25-useful-commands-in-linuxunix-for-beginners/</guid>
		<description><![CDATA[The (often a bit geeky for this blog) FreeBSD-World website has a good &#8220;Top-25&#8243; list of 25 useful commands in Linux/UNIX for Beginners (note: new URL updated 31 Aug 2008)
I&#8217;m not sure that #24 (dig) and #25 (host) are absolutely necessary, #18 (startx) is possibly outdated these days, and the compression tools (6-9) are much [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=60&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The (often a bit geeky for this blog) FreeBSD-World website has a good &#8220;Top-25&#8243; list of <a href="http://www.bsdworld.net/story.php?id=15">25 useful commands in Linux/UNIX for Beginners</a> (note: new URL updated 31 Aug 2008)</p>
<p>I&#8217;m not sure that #24 (<code>dig</code>) and #25 (<code>host</code>) are absolutely necessary, #18 (<code>startx</code>) is possibly outdated these days, and the compression tools (6-9) are much of a muchness, but apart from that, #1 &#8211; #23 should be familiar to anyone who claims to be experienced with UNIX/Linux. If somebody was missing one, it would have to be #18 (<code>startx</code>), as (a) it&#8217;s not needed on servers, and (b) modern *nix distros will boot into a GUI automatically when possible.</p>
<p>So what&#8217;s the list?<br />
25. host<br />
24. dig<br />
23. mkdir<br />
22. rm<br />
21. cp<br />
20. grep<br />
19. ls<br />
18. startx<br />
17. nano / vi<br />
16. pwd<br />
15. cat<br />
14. man<br />
13. kill<br />
12. locate<br />
11. ifconfig<br />
10. ssh<br />
9. gzip<br />
8. bzip2<br />
7. zip<br />
6. tar  (I would put 6-9 in one category, personally. rar should probably be in there too)<br />
5. mount<br />
4. passwd<br />
3. ping<br />
2. tail<br />
1. top</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nixshell.wordpress.com/60/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nixshell.wordpress.com/60/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=60&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2007/08/22/25-useful-commands-in-linuxunix-for-beginners/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
		<item>
		<title>vi</title>
		<link>http://nixshell.wordpress.com/2007/08/01/vi/</link>
		<comments>http://nixshell.wordpress.com/2007/08/01/vi/#comments</comments>
		<pubDate>Wed, 01 Aug 2007 00:40:10 +0000</pubDate>
		<dc:creator>unixshell</dc:creator>
				<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://nixshell.wordpress.com/2007/08/01/vi/</guid>
		<description><![CDATA[I use vi every day; to me, there is no better text editor. It is apparently a little intimidating for the newcomer, though&#8230;. here&#8217;s a beginner&#8217;s guide to the VI editor.
I would write one of these, but &#8211; much as I love vi, and I really do, everyone who uses vi, seems to have their [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=59&subd=nixshell&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I use vi every day; to me, there is no better text editor. It is apparently a little intimidating for the newcomer, though&#8230;. here&#8217;s a <a href="http://www-acs.ucsd.edu/info/vi_tutorial.shtml">beginner&#8217;s guide to the VI editor</a>.</p>
<p>I would write one of these, but &#8211; much as I love vi, and I really do, everyone who uses vi, seems to have their own experience of it, and their own shortcuts. We&#8217;ve all got our own quirks. One thing&#8217;s for sure; vi is not notepad!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nixshell.wordpress.com/59/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nixshell.wordpress.com/59/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nixshell.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nixshell.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nixshell.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nixshell.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nixshell.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nixshell.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nixshell.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nixshell.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nixshell.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nixshell.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nixshell.wordpress.com&blog=691157&post=59&subd=nixshell&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nixshell.wordpress.com/2007/08/01/vi/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8ab417ce7eba8048dd89d99088e7b7e5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">unixshell</media:title>
		</media:content>
	</item>
	</channel>
</rss>