<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title><![CDATA[All commands]]></title>
    <link>http://www.commandlinefu.com/commands/browse/rss</link>
    <description><![CDATA[A repository for the most elegant and useful UNIX commands.  Great commands can be shared, discussed and voted on to provide a comprehensive resource for working from the command-line]]></description>
    <pubDate>Fri, 10 Feb 2012 19:00:36 +0000</pubDate>
    <generator>Zend Framework Zend_Feed</generator>
    <language>en-us</language>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Command-line-fu" /><feedburner:info uri="command-line-fu" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title><![CDATA[Apache CLF access log format to CSV converter]]></title>
      <author>hute37</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/4EWxRxNFLCQ/apache-clf-access-log-format-to-csv-converter</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10234/apache-clf-access-log-format-to-csv-converter</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ #(see sample) $ cat x | perl -pe 'BEGIN{ print &amp;quot;TIME;...\n&amp;quot;; } s!(\S+) - (\S+) - \[(\d\d)/(\S\S\S)/(\S+):(\d\d):(\d\d:\d\d) \S+\] &amp;quot;(\S+) (.*/)(\S+)(?:\.([^?]*)(\?\S*)?) HTTP/\S+&amp;quot; (\d+) (\S+)!$3-$4-$5 $6:$7;$6;$2;$1;$8;$13;1;$14;$11;$10;$9;$12;!' &amp;gt; x.csv&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;- excel date compatible with a  separate hour field&lt;/p&gt;
&lt;p&gt;- added a fixed 1 for easier request counter aggregation&lt;/p&gt;
&lt;p&gt;- split URL in directory, filename, fileext,  query&lt;/p&gt;
&lt;p&gt;- used with tomcat valve with response bytes replaced by elapsed time&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10234/apache-clf-access-log-format-to-csv-converter"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/hute37"&gt;View all commands by &lt;strong&gt;hute37&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-p2SpsdpzKhv54e85N0_CbfIH_w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-p2SpsdpzKhv54e85N0_CbfIH_w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-p2SpsdpzKhv54e85N0_CbfIH_w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-p2SpsdpzKhv54e85N0_CbfIH_w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/4EWxRxNFLCQ" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 10 Feb 2012 16:58:50 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10234/apache-clf-access-log-format-to-csv-converter</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10234/apache-clf-access-log-format-to-csv-converter</feedburner:origLink></item>
    <item>
      <title><![CDATA[Cleanup a (source) text file, removing trailing spaces/tabs and multiple consecutive blank lines]]></title>
      <author>bibe (http://www.1729.it/blog)</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/ZLrQu7rXrpM/cleanup-a-source-text-file-removing-trailing-spacestabs-and-multiple-consecutive-blank-lines</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10231/cleanup-a-source-text-file-removing-trailing-spacestabs-and-multiple-consecutive-blank-lines</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ sed -i -e 's/[ \t]*$//;/^$/N;/\n$/D' sourcefiletocleanup&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;I used this command (in addition to a code formatting tool) to "cleanup" a bunch of PHP files&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10231/cleanup-a-source-text-file-removing-trailing-spacestabs-and-multiple-consecutive-blank-lines"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/bibe"&gt;View all commands by &lt;strong&gt;bibe&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ZYqY4CktcbbTyrZmlBHIutduTQs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZYqY4CktcbbTyrZmlBHIutduTQs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ZYqY4CktcbbTyrZmlBHIutduTQs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZYqY4CktcbbTyrZmlBHIutduTQs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/ZLrQu7rXrpM" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 10 Feb 2012 11:09:54 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10231/cleanup-a-source-text-file-removing-trailing-spacestabs-and-multiple-consecutive-blank-lines</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10231/cleanup-a-source-text-file-removing-trailing-spacestabs-and-multiple-consecutive-blank-lines</feedburner:origLink></item>
    <item>
      <title><![CDATA[Default value or argument]]></title>
      <author>f4m8</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/iPQK1zjznUc/default-value-or-argument</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10230/default-value-or-argument</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ num_lines=${1:-42}&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;Very similar but no use of `tr` for&lt;/p&gt;
&lt;p&gt;function liner() {&lt;/p&gt;
&lt;p&gt;  local num_lines=${1:-42}&lt;/p&gt;
&lt;p&gt;  local line=$(printf %${num_lines}s)&lt;/p&gt;
&lt;p&gt;  echo ${line// /#}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10230/default-value-or-argument"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/f4m8"&gt;View all commands by &lt;strong&gt;f4m8&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nkvBfC-12HW49JCIK_-BDUwpCZs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nkvBfC-12HW49JCIK_-BDUwpCZs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nkvBfC-12HW49JCIK_-BDUwpCZs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nkvBfC-12HW49JCIK_-BDUwpCZs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/iPQK1zjznUc" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 10 Feb 2012 06:24:20 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10230/default-value-or-argument</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10230/default-value-or-argument</feedburner:origLink></item>
    <item>
      <title><![CDATA[Default value or argument]]></title>
      <author>robinsonaarond</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/W5xoW7nLgFU/default-value-or-argument</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10227/default-value-or-argument</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ num_lines=${1:-42}&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;I used it for this function, which prints hashes:&lt;/p&gt;
&lt;p&gt;function liner {&lt;/p&gt;
&lt;p&gt;        num_lines=${1:-42}&lt;/p&gt;
&lt;p&gt;        echo&lt;/p&gt;
&lt;p&gt;        printf %${num_lines}s|tr " " "#"&lt;/p&gt;
&lt;p&gt;        echo&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Note the colon-dash, instead of the usual colon-equals.&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10227/default-value-or-argument"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/robinsonaarond"&gt;View all commands by &lt;strong&gt;robinsonaarond&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oWo60IGG3PYPfa-R4CPS0hlldrU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oWo60IGG3PYPfa-R4CPS0hlldrU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oWo60IGG3PYPfa-R4CPS0hlldrU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oWo60IGG3PYPfa-R4CPS0hlldrU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/W5xoW7nLgFU" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Feb 2012 17:31:33 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10227/default-value-or-argument</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10227/default-value-or-argument</feedburner:origLink></item>
    <item>
      <title><![CDATA[Print current running shell, PID]]></title>
      <author>robinsonaarond</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/l3XIBWxP6R8/print-current-running-shell-pid</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10226/print-current-running-shell-pid</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ ps -p $$&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;works as well as echo $0, but also prints process id, which pts you're using.  echo $SHELL doesn't always get updated when changing shells, so this is a better solution than that.  Just one more variation on a theme.&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10226/print-current-running-shell-pid"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/robinsonaarond"&gt;View all commands by &lt;strong&gt;robinsonaarond&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-NwswCymR3XcYgPcGDSkULeTxGs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-NwswCymR3XcYgPcGDSkULeTxGs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-NwswCymR3XcYgPcGDSkULeTxGs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-NwswCymR3XcYgPcGDSkULeTxGs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/l3XIBWxP6R8" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Feb 2012 17:27:45 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10226/print-current-running-shell-pid</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10226/print-current-running-shell-pid</feedburner:origLink></item>
    <item>
      <title><![CDATA[Revert selection with find.]]></title>
      <author>ohe (http://www.twitter.com/_olivier_)</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/lv43QyWGSMo/revert-selection-with-find.</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10223/revert-selection-with-find.</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ find . ! -name &amp;quot;*.tar.gz&amp;quot;&lt;/code&gt;
&lt;div style=""&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10223/revert-selection-with-find."&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/ohe"&gt;View all commands by &lt;strong&gt;ohe&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ytaShm82hpgrXrEDCbINEhvbW4o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ytaShm82hpgrXrEDCbINEhvbW4o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ytaShm82hpgrXrEDCbINEhvbW4o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ytaShm82hpgrXrEDCbINEhvbW4o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/lv43QyWGSMo" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Feb 2012 13:10:36 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10223/revert-selection-with-find.</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10223/revert-selection-with-find.</feedburner:origLink></item>
    <item>
      <title><![CDATA[Function that show the full path of every argument.]]></title>
      <author>flxndn</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/Gk8vs3mtxpQ/function-that-show-the-full-path-of-every-argument.</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10222/function-that-show-the-full-path-of-every-argument.</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ full() {local i;for i in $*;do readlink -f $i;done}&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;You can use the command "full" not only with one item, with items with diferent paths, and with relatives and absolute paths.&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10222/function-that-show-the-full-path-of-every-argument."&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/flxndn"&gt;View all commands by &lt;strong&gt;flxndn&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LTB5dqo8tQ2GpXkMnu3R0REvOhw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LTB5dqo8tQ2GpXkMnu3R0REvOhw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LTB5dqo8tQ2GpXkMnu3R0REvOhw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LTB5dqo8tQ2GpXkMnu3R0REvOhw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/Gk8vs3mtxpQ" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Feb 2012 11:40:05 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10222/function-that-show-the-full-path-of-every-argument.</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10222/function-that-show-the-full-path-of-every-argument.</feedburner:origLink></item>
    <item>
      <title><![CDATA[Check if a machine is online]]></title>
      <author>UnixNeko</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/kV3FVDH9RCw/check-if-a-machine-is-online</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10220/check-if-a-machine-is-online</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ ping -c 1 -q MACHINE_IP_OR_NAME &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&amp;amp; echo ONLINE || echo OFFLINE&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;PING&lt;/p&gt;
&lt;p&gt;parameters&lt;/p&gt;
&lt;p&gt;c 1 limits to 1 pinging attempt&lt;/p&gt;
&lt;p&gt;q makes the command quiet (or silent mode)&lt;/p&gt;
&lt;p&gt;/dev/null 2&gt;&amp;1 is to remove the display&lt;/p&gt;
&lt;p&gt;&amp;&amp; echo ONLINE is executed if previous command is successful (return value 0)&lt;/p&gt;
&lt;p&gt;|| echo OFFLINE is executed otherwise (return value of 1 if unreachable or 2 if you're offline yourself).&lt;/p&gt;
&lt;p&gt;I personally use this command as an alias with a predefined machine name but there are at least 2 improvements that may be done.&lt;/p&gt;
&lt;p&gt;Asking for the machine name or IP&lt;/p&gt;
&lt;p&gt;Escaping the output so that it displays ONLINE in green and OFFLINE in red (for instance).&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10220/check-if-a-machine-is-online"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/UnixNeko"&gt;View all commands by &lt;strong&gt;UnixNeko&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2xTSHvD-GJSACcwrOP_eRXA_GsQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2xTSHvD-GJSACcwrOP_eRXA_GsQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2xTSHvD-GJSACcwrOP_eRXA_GsQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2xTSHvD-GJSACcwrOP_eRXA_GsQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/kV3FVDH9RCw" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 09 Feb 2012 06:30:55 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10220/check-if-a-machine-is-online</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10220/check-if-a-machine-is-online</feedburner:origLink></item>
    <item>
      <title><![CDATA[ttyS0 - terminal on serial connection]]></title>
      <author>0disse0 (http://gplus.to/0disse0)</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/JK8-gKaR3mU/ttys0-terminal-on-serial-connection</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10218/ttys0-terminal-on-serial-connection</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ setserial -q /dev/ttyS0&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;I actually planned to do this for quite a long time, but since I haven't had any suitable client hardware, I procrastinated this.&lt;/p&gt;
&lt;p&gt;Now, the old laptop I've got from my dad, features an RS-232 port. So, now that I had technically a client, that I could test my RS-232 connection with, I ordered a null modem cable.&lt;/p&gt;
&lt;p&gt;There is no RS-232 outlet on my desktop computer directly on the mainboard, but theres a connector on the mainbord, where a RS-232 outlet can be attached to. The outlet will then cover up a PCI slot.&lt;/p&gt;
&lt;p&gt;# Activating RS-232&lt;/p&gt;
&lt;p&gt;Ok, once all cables were in place, I tried to access both RS-232 ports by reading from them directly. They're usually ttyS0 or ttyS1, depending what COM-Port it is.&lt;/p&gt;
&lt;p&gt;From the file /proc/tty/driver/serial, information about the serial setup can be obtained. &lt;/p&gt;
&lt;p&gt;A setserial -q /dev/ttyS0 might be usefull as well. Usually, the UART Type is 16550A, on a standard PC. Mine wasn't working though.&lt;/p&gt;
&lt;p&gt;At leas not right from the start, when I tried to read the interface with cat /dev/ttyS0 I got the following error:&lt;/p&gt;
&lt;p&gt;# cat /dev/ttyS0&lt;/p&gt;
&lt;p&gt;cat: /dev/ttyS0: Input/output error&lt;/p&gt;
&lt;p&gt;Obviously, the driver couldn't activate the hardware. Reason was, it was deactivated in BIOS. After activating RS-232 there, it worked well.&lt;/p&gt;
&lt;p&gt;As a last action, I added myself to the uucp group, so I have user permission to the serial lines. It is not necessary for the terminal setup, but a good idea to do so, just for future projects, maybe...&lt;/p&gt;
&lt;p&gt;# Setting up a terminal&lt;/p&gt;
&lt;p&gt;Once the Serial line is configured and working properly, it's time to let a terminal run on that port. This is what I added to my /etc/inittab :&lt;/p&gt;
&lt;p&gt;s0:2345:respawn:/sbin/agetty -L 38400 ttyS0&lt;/p&gt;
&lt;p&gt;I added it quite on the top of that file, right below the 'si' statement, mingetty cannot be used for serial connections, it cannot be run in a console, too. I tried it for testing purposes, but the cosole - along with your login program - will log you out, as soon as you log in over your serial line.&lt;/p&gt;
&lt;p&gt;'-L' means this is a local line, with no carrier signal. 38400 is the standard speed of a Linux console, it might be a bit high, I was told, but it works well. I tested that with some higher values as well (115200) and it worked too, I guess it tepends on things like cable length, etc. Last parameter, is the serial tty to listen on. The terminal type can be specified as an additional parameter at the end of the parameter list, vt102, for instance. This is sometimes required, depending on the client.&lt;/p&gt;
&lt;p&gt;After finishing editing /etc/inittab, an init q will make the system re-read /etc/inittab and apply changes. The agetty should now be listening on ttyS0.&lt;/p&gt;
&lt;p&gt;#Setting up a client&lt;/p&gt;
&lt;p&gt;It's time to establish a connection and test the serial line. I use a laptop, that has an RS-232 port, so some preliminary setup is required. I tried minicom as terminal initially, but it turned out, not to be the best client. It initializes the modem, this lasts quite long, and it doesn't convey ANSI colors. So the better option is cu, it's part of the UUCP-Package.&lt;/p&gt;
&lt;p&gt;Oh, and the serial port of that computer, has to be accessible as well, of course.&lt;/p&gt;
&lt;p&gt;Once everything was set up, I established the connection:&lt;/p&gt;
&lt;code&gt;cu -l ttyS0 -38400 --nostop&lt;/code&gt;
&lt;p&gt;Pretty self explanatory, I think. The --nostop option disables XON/XOFF handling.&lt;/p&gt;
&lt;p&gt;# root access over ttyS0&lt;/p&gt;
&lt;p&gt;In order to become root over the serial terminal, the tty needs to be added to /etc/securetty&lt;/p&gt;
&lt;p&gt;I appended ttyS0 to the end of the file. It is now possible, to gain root access over the serial terminal. The agetty process needs to be restarted to apply changes.&lt;/p&gt;
&lt;p&gt;# Accessing GRUB over ttyS0&lt;/p&gt;
&lt;p&gt;To make bootloader access possible over ttyS0, some changes to /boot/grub/menu.lst need to be done. (GRUB is the bootloader I use, I suppose LiLo has similar capabilities.)&lt;/p&gt;
&lt;p&gt;Those are the lines, I appended to the top of my menu.lst :&lt;/p&gt;
&lt;p&gt;serial --unit=0 --speed=38400 --word=8 --parity=no --stop=1&lt;/p&gt;
&lt;p&gt;terminal --timeout=3 serial console&lt;/p&gt;
&lt;p&gt;The serial  command initiates the serial terminal option, --unit=0 defines our first serial connector, I my case, it's the only one I have on my machine. I used the standard Linux-Console speed, as well as the "8N1" connection strategy. &lt;/p&gt;
&lt;p&gt;terminal defines the terminal priorities, first terminal (serial) is the standard one, the last one is the secondary terminal (console). &lt;/p&gt;
&lt;p&gt;--timeout=3 enables a delay on both consoles, with a prompt for a keystroke. Depending on which terminal, the key is pressed, this terminal, will be used. If no key is pressed after the timeout, the standard console (in my case serial) will be used.&lt;/p&gt;
&lt;p&gt;# Relaying Kernel output on boot&lt;/p&gt;
&lt;p&gt;The Kernel accepts multiple console options, of which the last one, is the standard console, and the one that will be used in Single User mode. These are my Kernel options:&lt;/p&gt;
&lt;p&gt;title Fedora Core (2.6.20-1.2316.fc5)&lt;/p&gt;
&lt;p&gt;root (hd0,0)&lt;/p&gt;
&lt;p&gt;kernel /vmlinuz-2.6.20-1.2316.fc5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet vga=795 console=tty0 console=ttyS0,38400&lt;/p&gt;
&lt;p&gt;initrd /initrd-2.6.20-1.2316.fc5.img&lt;/p&gt;
&lt;p&gt;console=tty0 is the standard console, located on the machine, i.e. monitor and keyboard.&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10218/ttys0-terminal-on-serial-connection"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/0disse0"&gt;View all commands by &lt;strong&gt;0disse0&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rwfUvm6JKzQVKYkixMpx_GJ1GqM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rwfUvm6JKzQVKYkixMpx_GJ1GqM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rwfUvm6JKzQVKYkixMpx_GJ1GqM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rwfUvm6JKzQVKYkixMpx_GJ1GqM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/JK8-gKaR3mU" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 08 Feb 2012 20:44:09 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10218/ttys0-terminal-on-serial-connection</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10218/ttys0-terminal-on-serial-connection</feedburner:origLink></item>
    <item>
      <title><![CDATA[Reverse SSH]]></title>
      <author>0disse0 (http://gplus.to/0disse0)</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/ADn57Z2km2Q/reverse-ssh</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10217/reverse-ssh</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ ssh -f -N -R 8888:localhost:22 user@somedomain.org&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;this command from the source server and this follow in the destination server: &lt;/p&gt;
&lt;p&gt;ssh user@localhost -p 8888&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10217/reverse-ssh"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/0disse0"&gt;View all commands by &lt;strong&gt;0disse0&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vYGrES24OnpE80q0h8xL6JU9xBY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vYGrES24OnpE80q0h8xL6JU9xBY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vYGrES24OnpE80q0h8xL6JU9xBY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vYGrES24OnpE80q0h8xL6JU9xBY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/ADn57Z2km2Q" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 08 Feb 2012 20:24:38 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10217/reverse-ssh</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10217/reverse-ssh</feedburner:origLink></item>
    <item>
      <title><![CDATA[shell function which allows you to tag files by creating symbolic links directories in a 'tags' folder.]]></title>
      <author>bartonski</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/-6-d0qNCsDI/shell-function-which-allows-you-to-tag-files-by-creating-symbolic-links-directories-in-a-tags-folder.</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10216/shell-function-which-allows-you-to-tag-files-by-creating-symbolic-links-directories-in-a-tags-folder.</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ tag() { local t=&amp;quot;$HOME/tags/$1&amp;quot;; [ -d $t ] || mkdir -p $t; shift; ln $* $t;}&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;The tag function takes a tag name as its first argument, then a list of files which take that tag. The directory $HOME/tags/tagname  will then hold symbolic links to each of the tagged files. This function was inspired by tmsu (found at https://bitbucket.org/oniony/tmsu/wiki/Home).&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;code&gt;tag dog airedale.txt .shizturc weimeraner.pl&lt;/code&gt;
&lt;p&gt;This will create $HOME/tags/dog which contains symbolic links to  airedale.txt .shizturc and weimeraner.pl&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10216/shell-function-which-allows-you-to-tag-files-by-creating-symbolic-links-directories-in-a-tags-folder."&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/bartonski"&gt;View all commands by &lt;strong&gt;bartonski&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OaEmC8a83yU6d4jTHrw0bVmv6Uk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OaEmC8a83yU6d4jTHrw0bVmv6Uk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OaEmC8a83yU6d4jTHrw0bVmv6Uk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OaEmC8a83yU6d4jTHrw0bVmv6Uk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/-6-d0qNCsDI" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 08 Feb 2012 12:40:45 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10216/shell-function-which-allows-you-to-tag-files-by-creating-symbolic-links-directories-in-a-tags-folder.</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10216/shell-function-which-allows-you-to-tag-files-by-creating-symbolic-links-directories-in-a-tags-folder.</feedburner:origLink></item>
    <item>
      <title><![CDATA[keylogger]]></title>
      <author>totti</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/AMEfEfkJmEM/keylogger</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10214/keylogger</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ python -c  &amp;quot;DEV = '/dev/input/event4' fo = open(DEV) def inn(k,s):     if s == 0:        print '%i up'%k     if s == 1:        print '%i down'%k  while 1:     l = fo.read(16)     if ord(l[10]) != 0:        k,s = l[10],l[12]        inn(ord(k),ord(s)) &amp;quot;&lt;/code&gt;
&lt;div style=""&gt;&lt;code&gt;python -c  &amp;quot;DEV = '/dev/input/event4' &lt;/code&gt;
&lt;p&gt;#if event0 doesn't work, try event1  event2 etc&lt;/p&gt;
&lt;p&gt;fo = open(DEV) &lt;/p&gt;
&lt;p&gt;def interpret(keycode,state): &lt;/p&gt;
&lt;p&gt;   if state == 0: &lt;/p&gt;
&lt;p&gt;      print '%i up'%keycode &lt;/p&gt;
&lt;p&gt;   if state == 1: &lt;/p&gt;
&lt;p&gt;      print '%i down'%keycode &lt;/p&gt;
&lt;p&gt;   if state == 2: &lt;/p&gt;
&lt;p&gt;      print '%i repeat'%keycode &lt;/p&gt;
&lt;p&gt;while 1: &lt;/p&gt;
&lt;p&gt;   line = fo.read(16) &lt;/p&gt;
&lt;p&gt;   if ord(line[10]) != 0: &lt;/p&gt;
&lt;p&gt;      keycode,state = line[10],line[12] &lt;/p&gt;
&lt;p&gt;      interpret(ord(keycode),ord(state))&lt;/p&gt;
&lt;p&gt;"&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10214/keylogger"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/totti"&gt;View all commands by &lt;strong&gt;totti&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/c061-qxsi2kpIZxhG9pqvMoki08/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/c061-qxsi2kpIZxhG9pqvMoki08/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/c061-qxsi2kpIZxhG9pqvMoki08/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/c061-qxsi2kpIZxhG9pqvMoki08/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/AMEfEfkJmEM" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 08 Feb 2012 12:11:23 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10214/keylogger</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10214/keylogger</feedburner:origLink></item>
    <item>
      <title><![CDATA[grep directory and sub-directories]]></title>
      <author>totti</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/8mkOyP4TTD0/grep-directory-and-sub-directories</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10211/grep-directory-and-sub-directories</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ grep -r &amp;lt;searchterm&amp;gt; *&lt;/code&gt;
&lt;div style=""&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10211/grep-directory-and-sub-directories"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/totti"&gt;View all commands by &lt;strong&gt;totti&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5XgGFc1JlOnnRS_ihqky2seZBFg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5XgGFc1JlOnnRS_ihqky2seZBFg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5XgGFc1JlOnnRS_ihqky2seZBFg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5XgGFc1JlOnnRS_ihqky2seZBFg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/8mkOyP4TTD0" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 08 Feb 2012 11:48:08 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10211/grep-directory-and-sub-directories</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10211/grep-directory-and-sub-directories</feedburner:origLink></item>
    <item>
      <title><![CDATA[gawk gets fixed width field]]></title>
      <author>unixmonkey21861</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/ZRQJg3Ol31o/gawk-gets-fixed-width-field</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10209/gawk-gets-fixed-width-field</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ ls -l | gawk -v FIELDWIDTHS='1 3 3 3' '{print $2}'&lt;/code&gt;
&lt;div style=""&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10209/gawk-gets-fixed-width-field"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/unixmonkey21861"&gt;View all commands by &lt;strong&gt;unixmonkey21861&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QVYYpbjCIqLTOCKUKQQDdSIBxn4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QVYYpbjCIqLTOCKUKQQDdSIBxn4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QVYYpbjCIqLTOCKUKQQDdSIBxn4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QVYYpbjCIqLTOCKUKQQDdSIBxn4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/ZRQJg3Ol31o" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 08 Feb 2012 08:18:25 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10209/gawk-gets-fixed-width-field</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10209/gawk-gets-fixed-width-field</feedburner:origLink></item>
    <item>
      <title><![CDATA[what model of computer I'm using?]]></title>
      <author>bbbco (http://www.briandgoad.com)</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/l2AXOuI34bw/what-model-of-computer-im-using</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10208/what-model-of-computer-im-using</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ sudo dmidecode | grep Product&lt;/code&gt;
&lt;div style=""&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10208/what-model-of-computer-im-using"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/bbbco"&gt;View all commands by &lt;strong&gt;bbbco&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1rKrzolcL3y0c0D1dJTKWqlndBI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1rKrzolcL3y0c0D1dJTKWqlndBI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1rKrzolcL3y0c0D1dJTKWqlndBI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1rKrzolcL3y0c0D1dJTKWqlndBI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/l2AXOuI34bw" height="1" width="1"/&gt;</description>
      <pubDate>Tue, 07 Feb 2012 16:26:23 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10208/what-model-of-computer-im-using</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10208/what-model-of-computer-im-using</feedburner:origLink></item>
    <item>
      <title><![CDATA[Create new user with home dir and given password]]></title>
      <author>0disse0 (http://gplus.to/0disse0)</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/DEY2Ak_b1Pk/create-new-user-with-home-dir-and-given-password</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10200/create-new-user-with-home-dir-and-given-password</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ useradd -m -p $(perl -e'print crypt(&amp;quot;passwordscelta&amp;quot;, &amp;quot;stigghiola&amp;quot;)') user&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;The crypt function takes a password, key, as a string, and a salt character array which is described below, and returns a printable ASCII string which starts with another salt. It is believed that, given the output of the function, the best way to find a key that will produce that output is to guess values of key until the original value of key is found.&lt;/p&gt;
&lt;p&gt;from &lt;a href="http://en.wikipedia.org/wiki/Crypt_(Unix)" rel="nofollow"&gt;http://en.wikipedia.org/wiki/Crypt_(Unix)&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10200/create-new-user-with-home-dir-and-given-password"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/0disse0"&gt;View all commands by &lt;strong&gt;0disse0&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OKHoJKxQ4cSBzKd3XlvtWFWrzxM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OKHoJKxQ4cSBzKd3XlvtWFWrzxM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OKHoJKxQ4cSBzKd3XlvtWFWrzxM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OKHoJKxQ4cSBzKd3XlvtWFWrzxM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/DEY2Ak_b1Pk" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 06 Feb 2012 19:53:01 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10200/create-new-user-with-home-dir-and-given-password</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10200/create-new-user-with-home-dir-and-given-password</feedburner:origLink></item>
    <item>
      <title><![CDATA[I am using a desktop?]]></title>
      <author>0disse0 (http://gplus.to/0disse0)</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/cNnRclzAq1w/i-am-using-a-desktop</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10199/i-am-using-a-desktop</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ sudo hal-get-property --udi /org/freedesktop/Hal/devices/computer --key 'system.formfactor'&lt;/code&gt;
&lt;div style=""&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10199/i-am-using-a-desktop"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/0disse0"&gt;View all commands by &lt;strong&gt;0disse0&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bG9RDhRY-kVj2rfwhBRmjQaF73g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bG9RDhRY-kVj2rfwhBRmjQaF73g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bG9RDhRY-kVj2rfwhBRmjQaF73g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bG9RDhRY-kVj2rfwhBRmjQaF73g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/cNnRclzAq1w" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 06 Feb 2012 19:44:44 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10199/i-am-using-a-desktop</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10199/i-am-using-a-desktop</feedburner:origLink></item>
    <item>
      <title><![CDATA[what model of computer I'm using?]]></title>
      <author>0disse0 (http://gplus.to/0disse0)</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/duBavanFFCk/what-model-of-computer-im-using</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10198/what-model-of-computer-im-using</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ sudo hal-get-property --udi /org/freedesktop/Hal/devices/computer --key 'system.hardware.product'&lt;/code&gt;
&lt;div style=""&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10198/what-model-of-computer-im-using"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/0disse0"&gt;View all commands by &lt;strong&gt;0disse0&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/d2sOEV3zAmRfOLNR2genQYpbMz8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/d2sOEV3zAmRfOLNR2genQYpbMz8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/d2sOEV3zAmRfOLNR2genQYpbMz8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/d2sOEV3zAmRfOLNR2genQYpbMz8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/duBavanFFCk" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 06 Feb 2012 19:43:57 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10198/what-model-of-computer-im-using</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10198/what-model-of-computer-im-using</feedburner:origLink></item>
    <item>
      <title><![CDATA[how to allow a program to listen through the firewall]]></title>
      <author>0disse0 (http://gplus.to/0disse0)</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/b7_V-n9JQbY/how-to-allow-a-program-to-listen-through-the-firewall</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10197/how-to-allow-a-program-to-listen-through-the-firewall</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ netsh firewall add programmaautorizzato C:\nltest.exe mltest enable&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;To allow a program ("programmaautorizzato" in example) to listen through the firewall&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10197/how-to-allow-a-program-to-listen-through-the-firewall"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/0disse0"&gt;View all commands by &lt;strong&gt;0disse0&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VIEYs8h2z8FKKpMtVN37rMLo2f0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VIEYs8h2z8FKKpMtVN37rMLo2f0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VIEYs8h2z8FKKpMtVN37rMLo2f0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VIEYs8h2z8FKKpMtVN37rMLo2f0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/b7_V-n9JQbY" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 06 Feb 2012 19:33:57 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10197/how-to-allow-a-program-to-listen-through-the-firewall</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10197/how-to-allow-a-program-to-listen-through-the-firewall</feedburner:origLink></item>
    <item>
      <title><![CDATA[Send e-mail if host is 'dead' or not reachable]]></title>
      <author>bashrc</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/NcQZuKdWRDk/send-e-mail-if-host-is-dead-or-not-reachable</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10196/send-e-mail-if-host-is-dead-or-not-reachable</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ 10,30,50 * * * * ping -c1 -w3 192.168.0.14 &amp;gt;/dev/null&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;Cleaner with a mailto assignment in crontab (if the command fails you get an email):&lt;/p&gt;
&lt;p&gt;MAILTO=admin@example.com&lt;/p&gt;
&lt;p&gt;10,30,50 * * * * ping -q -c1 -w3 192.168.0.14 &gt;/dev/null&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10196/send-e-mail-if-host-is-dead-or-not-reachable"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/bashrc"&gt;View all commands by &lt;strong&gt;bashrc&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5whGeDlomLSDzDSAEPUinWn7NQU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5whGeDlomLSDzDSAEPUinWn7NQU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5whGeDlomLSDzDSAEPUinWn7NQU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5whGeDlomLSDzDSAEPUinWn7NQU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/NcQZuKdWRDk" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 06 Feb 2012 14:54:15 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10196/send-e-mail-if-host-is-dead-or-not-reachable</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10196/send-e-mail-if-host-is-dead-or-not-reachable</feedburner:origLink></item>
    <item>
      <title><![CDATA[Send e-mail if host is 'dead' or not reachable]]></title>
      <author>knoppix5</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/1ANj8YVHSI4/send-e-mail-if-host-is-dead-or-not-reachable</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10189/send-e-mail-if-host-is-dead-or-not-reachable</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ 10,30,50 * * * * ping -q -c1 -w3 192.168.0.14 | grep '1 received' - || mail -ne -s'Host 192.168.0.14 not reachable' admin@example.com&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;Every 20 minutes test if host with IP 192.168.0.14 is 'dead' or not reachable.&lt;/p&gt;
&lt;p&gt;The line should be put in your crontab file.&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10189/send-e-mail-if-host-is-dead-or-not-reachable"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/knoppix5"&gt;View all commands by &lt;strong&gt;knoppix5&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fBzglogWm-WyrefIHf6nxcWCHMQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fBzglogWm-WyrefIHf6nxcWCHMQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fBzglogWm-WyrefIHf6nxcWCHMQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fBzglogWm-WyrefIHf6nxcWCHMQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/1ANj8YVHSI4" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 06 Feb 2012 10:42:46 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10189/send-e-mail-if-host-is-dead-or-not-reachable</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10189/send-e-mail-if-host-is-dead-or-not-reachable</feedburner:origLink></item>
    <item>
      <title><![CDATA[Make alert if host is 'dead' or not reachable]]></title>
      <author>knoppix5</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/haOC3RrJxkI/make-alert-if-host-is-dead-or-not-reachable</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10188/make-alert-if-host-is-dead-or-not-reachable</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ 10,30,50 * * * * ping -q -c1 -w3 192.168.0.14 | grep '1 received' - || env DISPLAY=:0 xeyes&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;Every 20 minutes ping host with IP address  192.168.0.14. If it's not 'alive' or not reachable, then display something eye-catching (here xeyes) on the desktop.&lt;/p&gt;
&lt;p&gt;Hint for newbies: edit crontab with&lt;/p&gt;
&lt;code&gt;crontab -e&lt;/code&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10188/make-alert-if-host-is-dead-or-not-reachable"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/knoppix5"&gt;View all commands by &lt;strong&gt;knoppix5&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PlO4MA_SldlM6oUbBA_7VBPgf0w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PlO4MA_SldlM6oUbBA_7VBPgf0w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PlO4MA_SldlM6oUbBA_7VBPgf0w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PlO4MA_SldlM6oUbBA_7VBPgf0w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/haOC3RrJxkI" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 06 Feb 2012 09:40:11 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10188/make-alert-if-host-is-dead-or-not-reachable</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10188/make-alert-if-host-is-dead-or-not-reachable</feedburner:origLink></item>
    <item>
      <title><![CDATA[before writing a new script]]></title>
      <author>sharfah (http://fahdshariff.blogspot.com)</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/C2KPCxZvpQY/before-writing-a-new-script</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10186/before-writing-a-new-script</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ echo '#!'$(which bash) &amp;gt; script.sh&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;Writes out the shebang line (#!/bin/bash) to the script.&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10186/before-writing-a-new-script"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/sharfah"&gt;View all commands by &lt;strong&gt;sharfah&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1JteS3G2HmkTk2CKyqjVQMLn1JA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1JteS3G2HmkTk2CKyqjVQMLn1JA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1JteS3G2HmkTk2CKyqjVQMLn1JA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1JteS3G2HmkTk2CKyqjVQMLn1JA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/C2KPCxZvpQY" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 06 Feb 2012 08:25:27 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10186/before-writing-a-new-script</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10186/before-writing-a-new-script</feedburner:origLink></item>
    <item>
      <title><![CDATA[Progress bar for MySQL import]]></title>
      <author>wr8cr8</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/34ZgXCnn3CI/progress-bar-for-mysql-import</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10185/progress-bar-for-mysql-import</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ pv -i 1 -p -t -e /path/to/sql/dump | mysql -u USERNAME -p DATABASE_NAME&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;Print out the progress of MySQL import using the pv command. Updates every second.&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10185/progress-bar-for-mysql-import"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/wr8cr8"&gt;View all commands by &lt;strong&gt;wr8cr8&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/V03jQQIrptM7-4TeSCfx8hZoAdc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/V03jQQIrptM7-4TeSCfx8hZoAdc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/V03jQQIrptM7-4TeSCfx8hZoAdc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/V03jQQIrptM7-4TeSCfx8hZoAdc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/34ZgXCnn3CI" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 06 Feb 2012 08:16:55 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10185/progress-bar-for-mysql-import</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10185/progress-bar-for-mysql-import</feedburner:origLink></item>
    <item>
      <title><![CDATA[before writing a new script]]></title>
      <author>unixmonkey21861</author>
      <link>http://feedproxy.google.com/~r/Command-line-fu/~3/_9F9ui1Yl80/before-writing-a-new-script</link>
      <guid isPermaLink="false">http://www.commandlinefu.com/commands/view/10184/before-writing-a-new-script</guid>
      <description>&lt;code style="padding:5px; font-family:monospace; font-size:12pt"&gt;$ which awk &amp;gt; script.awk&lt;/code&gt;
&lt;div style=""&gt;&lt;p&gt;write first line `#!`&lt;/p&gt;&lt;/div&gt;
&lt;ul style="list-style:none; padding: 0; margin: 0"&gt;
    &lt;li&gt;&lt;a href="http://www.commandlinefu.com/commands/view/10184/before-writing-a-new-script"&gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/commands/by/unixmonkey21861"&gt;View all commands by &lt;strong&gt;unixmonkey21861&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.commandlinefu.com"&gt;&lt;img src="http://www.commandlinefu.com/images/small-logo.jpg" alt="commandlinefu.com"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&lt;a href="http://codeinthehole.com"&gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KmGxA2o_Qxv9DbSTnSmYTBnXn1w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KmGxA2o_Qxv9DbSTnSmYTBnXn1w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KmGxA2o_Qxv9DbSTnSmYTBnXn1w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KmGxA2o_Qxv9DbSTnSmYTBnXn1w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Command-line-fu/~4/_9F9ui1Yl80" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 06 Feb 2012 01:03:22 +0000</pubDate>
      <comments>http://www.commandlinefu.com/commands/view/10184/before-writing-a-new-script</comments>
    <feedburner:origLink>http://www.commandlinefu.com/commands/view/10184/before-writing-a-new-script</feedburner:origLink></item>
  </channel>
</rss>

