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

<channel>
	<title>binpoint.com &#187; Unix</title>
	<atom:link href="http://binpoint.com/category/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://binpoint.com</link>
	<description>A Security Blog (Stirred with Geek Life)</description>
	<lastBuildDate>Wed, 09 Jun 2010 02:02:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Quick note on sorting john.pot files</title>
		<link>http://binpoint.com/2010/06/quick-note-on-sorting-john-pot-files/</link>
		<comments>http://binpoint.com/2010/06/quick-note-on-sorting-john-pot-files/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 02:02:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[john the ripper]]></category>
		<category><![CDATA[password cracking]]></category>

		<guid isPermaLink="false">http://binpoint.com/?p=719</guid>
		<description><![CDATA[I run john the ripper on multiple boxes at once by splitting up the input password hash files by type (NT, LanMan, DES, md5, etc.) Once I&#8217;ve let the individual systems run for a while, I run reports using  john - -show. This means I need to combine the john.pot files from each system into [...]


Related posts:<ol><li><a href='http://binpoint.com/2010/02/john-the-ripper-password-cracking-now-obsolete/' rel='bookmark' title='Permanent Link: John the Ripper Password Cracking Now Obsolete'>John the Ripper Password Cracking Now Obsolete</a></li>
<li><a href='http://binpoint.com/2009/03/complete-unix-cron-job-crib-sheet/' rel='bookmark' title='Permanent Link: Complete Unix Cron Job Crib Sheet'>Complete Unix Cron Job Crib Sheet</a></li>
<li><a href='http://binpoint.com/2009/05/auc-2-ls/' rel='bookmark' title='Permanent Link: AUC #2: ls'>AUC #2: ls</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-722" title="pot" src="http://binpoint.com/wp-content/uploads/2010/06/pot.png" alt="" width="304" height="301" /></p>
<p>I run <a href="http://www.openwall.com/john/">john the ripper</a> on multiple boxes at once by splitting up the input password hash files by type (NT, LanMan, DES, md5, etc.)</p>
<p>Once I&#8217;ve let the individual systems run for a while, I run reports using  <em>john</em> <em>- -show</em>. This means I need to combine the john.pot files from each system into a unique file on the system I&#8217;m running the reports on.</p>
<p>So, I ran the (fairly standard) commands:</p>
<p><em><strong>$ cat john1.pot john2.pot john3.pot &gt; combined.pot</strong><br />
</em></p>
<p><em><strong>$ cat combined.pot | sort | uniq &gt; john.pot</strong><br />
sort: string comparison failed: Illegal byte sequence<br />
sort: Set LC_ALL=&#8217;C&#8217; to work around the problem.<br />
sort: The strings compared were `1234567892031276d66b123456789:user&#8217; and `abcdefghijklmnop4ab</em><em>38:l\</em><em>4327367qrstuvwxyz&#8217;.</em></p>
<p>Oops! I wasn&#8217;t expecting that command to bomb out like that. To fix the sort, do exactly as sort suggests. Type:</p>
<p><strong>$ export LC_ALL=&#8217;C&#8217;</strong></p>
<p><strong><br />
</strong></p>
<p>What&#8217;s going on here?</p>
<p>I found <a href="http://www.opengroup.org/onlinepubs/007908799/xbd/envvar.html">this reference webpage</a> on Google. Here&#8217;s the relevant bits:</p>
<dl>
<dt><em>LC_ALL</em></dt>
<dd> <em>This variable determines the values for all locale categories. The value of the </em><em>LC_ALL environment variable has precedence over any of the other environment variables starting with </em><em>LC_ (</em><em>LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, LC_TIME) and the </em><em>LANG environment variable. </em></dd>
</dl>
<p><em>If the </em><em>LANG</em> environment variable is not set or is set to the empty string, the implementation-dependent default locale is used.</p>
<p><em>If the locale value is &#8220;C&#8221; or &#8220;POSIX&#8221;, the POSIX locale is used and the standard utilities behave in accordance with the rules in  POSIX Locale , for the associated category.</em></p>


<p>Related posts:<ol><li><a href='http://binpoint.com/2010/02/john-the-ripper-password-cracking-now-obsolete/' rel='bookmark' title='Permanent Link: John the Ripper Password Cracking Now Obsolete'>John the Ripper Password Cracking Now Obsolete</a></li>
<li><a href='http://binpoint.com/2009/03/complete-unix-cron-job-crib-sheet/' rel='bookmark' title='Permanent Link: Complete Unix Cron Job Crib Sheet'>Complete Unix Cron Job Crib Sheet</a></li>
<li><a href='http://binpoint.com/2009/05/auc-2-ls/' rel='bookmark' title='Permanent Link: AUC #2: ls'>AUC #2: ls</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://binpoint.com/2010/06/quick-note-on-sorting-john-pot-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Network Scanning with nmap</title>
		<link>http://binpoint.com/2010/04/network-scanning-with-nmap/</link>
		<comments>http://binpoint.com/2010/04/network-scanning-with-nmap/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 05:50:17 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Information Security]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[pentesting]]></category>
		<category><![CDATA[scanning]]></category>

		<guid isPermaLink="false">http://binpoint.com/?p=653</guid>
		<description><![CDATA[Shopping List Before we start, make sure you have the following ingredients ready to go: Fydor’s nmap – The true king of network scanners OpenVAS – The glamor queen of vulnerability assessors Start Here The first thing you need to determine is if you will be performing a black box test or a glass box [...]


Related posts:<ol><li><a href='http://binpoint.com/2008/06/thousands-of-sacrificial-lambs/' rel='bookmark' title='Permanent Link: Thousands of Sacrificial Lambs'>Thousands of Sacrificial Lambs</a></li>
<li><a href='http://binpoint.com/2008/06/writing-a-dns-sniffer/' rel='bookmark' title='Permanent Link: Writing a DNS sniffer'>Writing a DNS sniffer</a></li>
<li><a href='http://binpoint.com/2008/06/detectin-bad-tcp-sessions/' rel='bookmark' title='Permanent Link: Detecting bad TCP sessions'>Detecting bad TCP sessions</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-707" title="nmap_pic1" src="http://binpoint.com/wp-content/uploads/2010/04/nmap_pic1.png" alt="" width="367" height="212" /></p>
<p><strong>Shopping List</strong><br />
Before we start, make sure you have the following ingredients ready to go:</p>
<ul>
<li>Fydor’s <a href="http://nmap.org/">nmap</a> – The true king of network scanners</li>
<li><a href="http://www.openvas.org/">OpenVAS</a> – The glamor queen of vulnerability assessors</li>
</ul>
<p><strong>Start Here</strong><br />
The first thing you need to determine is if you will be performing a black box test or a glass box (often referred to as crystal box) test. I will only quickly go over the differences here.</p>
<p><strong>The Fairest Box of All</strong><br />
Black box testing is the &#8220;simplest&#8221; as you are only provided the IP Addresses in scope of the assessment. That’s it. You are not told how many Windows systems to expect, how many firewalls may be in your way or even if an IPS may shut down your scan if you are too aggressive with your timing options (we’ll touch on that later in this article.) It is difficult to accurately predict how long this may take as the composition of every network is different. An extreme example is if you are scanning through ocean floor fiber it could take quite some time when each packet suffers 250ms+ latency.</p>
<p>Glass box testing is typically much quicker to perform as your client will be providing architectural details of how the network is bolted together. It’s best to ask for network diagrams plus a real live human being to help you decipher them. (I mean seriously, how many UML network diagrams have you seen?) This is important not only because they may use abbreviations unknown to you or how closely the diagram aligns with reality or even all the labels they scribbled on by hand are subject to the lost art that is penmanship. Err, graphmanship.</p>
<p><strong>Scope Up!</strong><br />
Once the transparency of your target environment is agreed upon, you will need to define the scope of which portions of the target organization’s network is within scope for the assessment.</p>
<p>Ask for hosts which must NOT be scanned as they will fall over seizing due to poor IP/TCP stack implementations or other programming bugs. Place into “exclude.list”</p>
<p>Place the authorized IP address ranges and domains you were provided into “inscope.list”</p>
<p><strong>Just a Minor Technicality</strong><br />
Ok, we are now ready to dominate the world with our awesomeness! Or at the very least impress your client with a thorough report&#8230;</p>
<p>If you are scanning a class B network (10.10.X.X) or smaller, you will likely want to choose <strong>-T4</strong> for your speed setting. If you are attempting to map the Internet, stop now. <a href="http://insecure.org/presentations/BHDC08/bhdc08-slides-fyodor.pdf">Fydor has beaten you to it</a> <img src='http://binpoint.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>The Need For Speed</strong><br />
The <strong>–n</strong> switch will disable DNS lookups, reducing overall start to finish time as you no longer need to wait for all those UDP DNS request / responses to file in.</p>
<p>Setting how fast nmap chucks packets onto the network is controlled with:<br />
<strong>-T</strong>, <strong>&#8211;scan-delay</strong> and <strong>—min-hostgroup</strong><br />
<strong>-T5</strong> is balls to the wall and <strong>–T0</strong> means you never want it to finish&#8230;</p>
<p>A safe choice is <strong>–T3</strong> (the default) but again you will likely want to use <strong>-T4</strong> to save time.</p>
<p><strong>Top Heavy Servers</strong><br />
Scanning for every in-scope IP Address plus 65,535 port combinations to gather an inventory of live hosts could last longer than your contract engagement. You may need to pick 20 to 30 ports. In a perfect scenario, at least one of these ports will be open on every server that you need to find. Use <strong>-p</strong> to specify destination ports; a good starting list are the following UDP (<strong>U:</strong>) and TCP (<strong>T:</strong>) ports:<br />
<strong>-p U:53,111,137,T:21-25,80,135,139,443,445,3389,8080</strong></p>
<p>If your client has no idea what services they expect to find on their network, you now have permission to cry like a baby because they will have problems with your report regardless of what you find. T-T<br />
All seriousness aside, thanks to Fydor’s Internet mapping project I mentioned earlier, you can just substitute the defined list with Fydor’s results by adding:<br />
<strong>&#8211;top-ports 30 </strong> (where 30 is the number of ports you want to scan)</p>
<p><strong>I Know That Look&#8230;<br />
</strong>nmap is more than just a simple inventory scanner. It can also guess what the target operating system and it&#8217;s network accessible service names and versions are. It does this by looking at distinguishing features of a packet or connection (such as what the starting TTL value is or how it responds to an unsolicited RST packet sent to a closed port.) This technique is referred to as fingerprinting. If nmap is unsure about a target host, it will guess (and tell you as much) and if it is completely baffled it will politely ask you to submit a fingerprint to add to the nmap database along with what you determine the target to be (by other means.)</p>
<p><strong>-sV</strong> will attempt to match the name and version of each open network service that is discovered<br />
<strong>-O</strong> will attempt to match the operating system of target boxen</p>
<p><strong>New Implants</strong><br />
nmap has received some really neat upgrades since version 4.something such as the ability to run lua scripts during the scan process. An example:<br />
<strong>&#8211;script </strong><strong>smb-os-discovery</strong></p>
<p>Make sure you are using the latest scripts by running:<br />
<strong>nmap —script-updatedb</strong></p>
<p><strong>Putting it all Together</strong><strong><br />
</strong></p>
<p>Thus far, we have compiled the following nmap command:</p>
<p><strong>nmap –iL inscope.list —excludefile exclude.list –v –sS –n —reason –T4 —script </strong><strong>smb-os-discovery</strong><strong> –sV –O —top-ports 30</strong></p>
<p>Sweep 1: I highly recommend swapping out <strong>–sS</strong> with <strong>–sL</strong> before you run your final scan. Why? A list of hosts to be scanned is a great piece of information to include in your report to PROVE that you only touched systems that you were expressly authorized to touch. Yes, this is just feeding back information they originally provided you&#8230; Hey, this is why consultants get paid the big bucks right?</p>
<p>Sweep 2: swap out <strong>–sS</strong> with <strong>–sP</strong> to icmp scan for which hosts you are able to receive echo replies from. Consider sending this list to your client immediately to verify that your are in the ballpark prior to the &#8220;real&#8221; scan. Obviously, this can be skipped if a networking device (such as a router or firewall) is dropping all your icmp echo request probes.</p>
<p>Sweep 3: <strong>-sS</strong> for the win! This is your traditional half open SYN scan. Nmap will send out a TCP SYN packet to each IP address and port combination as you specified to determine if it returns a SYN+ACK packet, indicating an open port. If it doesn&#8217;t hear back from the target, it&#8217;s assumed to be closed. (Yes, this is where the increased timing option pays off.)</p>
<p><strong>Wrapping Up</strong></p>
<p>If you are running up against an IPS blocking your aggressive scans by sending you RSTs or dropping your packets silently, try setting <strong>–f </strong>to fragment (split up) your packets to a smaller portion of their maximum transmission unit (MTU) or size. This may just be enough to fool (or crash) that pesky IPS into letting them all pass on their merry way for total target box domination. Make sure you have permission to try this from the client first&#8230;</p>
<p>This was intended to be a pick up and go article and not dig too deep into how network scanning works nor the intricacies of nmap. If you want WAY more info than I&#8217;ve provided here, I highly recommend buying <a href="http://www.amazon.com/gp/product/0979958717?ie=UTF8&amp;tag=binpoint-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0979958717">Fydor&#8217;s nmap book</a>. If you can&#8217;t spare a few bucks, it&#8217;s also <a href="http://nmap.org/book/nse.html">available online for free</a>.</p>
<p><em>Stay tuned for Part 2, which covers <a href="http://www.openvas.org/">OpenVAS</a>.</em></p>


<p>Related posts:<ol><li><a href='http://binpoint.com/2008/06/thousands-of-sacrificial-lambs/' rel='bookmark' title='Permanent Link: Thousands of Sacrificial Lambs'>Thousands of Sacrificial Lambs</a></li>
<li><a href='http://binpoint.com/2008/06/writing-a-dns-sniffer/' rel='bookmark' title='Permanent Link: Writing a DNS sniffer'>Writing a DNS sniffer</a></li>
<li><a href='http://binpoint.com/2008/06/detectin-bad-tcp-sessions/' rel='bookmark' title='Permanent Link: Detecting bad TCP sessions'>Detecting bad TCP sessions</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://binpoint.com/2010/04/network-scanning-with-nmap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Study indicates MacBooks are pretty reliable</title>
		<link>http://binpoint.com/2009/11/study-indicates-macbooks-are-pretty-reliable/</link>
		<comments>http://binpoint.com/2009/11/study-indicates-macbooks-are-pretty-reliable/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 23:32:30 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://binpoint.com/?p=484</guid>
		<description><![CDATA[A laptop reliability study conducted by Squaretrade reveals most reliable laptop manufactures. The sample size was from over 30,000 devices over a 3 year lifetime. No big surprises here as the cheaper bargain laptops and netbooks round out the highest failure rates and the more expensive systems last longer. The linked PDF is full of [...]


Related posts:<ol><li><a href='http://binpoint.com/2009/01/dell-mini-10-my-next-toy-purchase/' rel='bookmark' title='Permanent Link: Dell Mini 10 &#8211; My Next Toy Purchase'>Dell Mini 10 &#8211; My Next Toy Purchase</a></li>
<li><a href='http://binpoint.com/2009/03/computer-security-at-hotels/' rel='bookmark' title='Permanent Link: Computer Security At Hotels'>Computer Security At Hotels</a></li>
<li><a href='http://binpoint.com/2010/04/network-scanning-with-nmap/' rel='bookmark' title='Permanent Link: Network Scanning with nmap'>Network Scanning with nmap</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style="text-align:center;"><img src="http://binpoint.com/wp-content/uploads/2009/11/17nov09compach0qw83.jpg" border="0" alt="17nov09compach0qw83.jpg" width="600" height="350" /></div>
<p>A laptop reliability study conducted by <a href="http://www.squaretrade.com/">Squaretrade</a> reveals most reliable laptop manufactures. The sample size was from over 30,000 devices over a 3 year lifetime. No big surprises here as the cheaper bargain laptops and netbooks round out the highest failure rates and the more expensive systems last longer. The linked PDF is full of pretty graphs which is always a win.</p>
<p>Of personal importance is my current laptop manufacturer of choice <a href="http://www.apple.com/macbookpro/">the Macbook Pro</a>&#8216;s ranking in the study.</p>
<p>[via <a href="http://www.engadget.com/2009/11/17/laptop-reliability-survey-asus-and-toshiba-win-hp-fails/">Engadget</a>]</p>


<p>Related posts:<ol><li><a href='http://binpoint.com/2009/01/dell-mini-10-my-next-toy-purchase/' rel='bookmark' title='Permanent Link: Dell Mini 10 &#8211; My Next Toy Purchase'>Dell Mini 10 &#8211; My Next Toy Purchase</a></li>
<li><a href='http://binpoint.com/2009/03/computer-security-at-hotels/' rel='bookmark' title='Permanent Link: Computer Security At Hotels'>Computer Security At Hotels</a></li>
<li><a href='http://binpoint.com/2010/04/network-scanning-with-nmap/' rel='bookmark' title='Permanent Link: Network Scanning with nmap'>Network Scanning with nmap</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://binpoint.com/2009/11/study-indicates-macbooks-are-pretty-reliable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Chrome OS To Launch Within A Week</title>
		<link>http://binpoint.com/2009/11/google-chrome-os-to-launch-within-a-week/</link>
		<comments>http://binpoint.com/2009/11/google-chrome-os-to-launch-within-a-week/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 03:54:06 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://binpoint.com/?p=494</guid>
		<description><![CDATA[Google&#8217;s Chrome OS project, first announced in July, will become available for download within a week, we&#8217;ve heard from a reliable source. Google previously said to expect an early version of the OS in the fall. (Via Linux.com :: Features.) Related posts:Updated Google Docs Drawing I sure miss grep in M$ Windows alltop


Related posts:<ol><li><a href='http://binpoint.com/2010/05/updated-google-docs-drawing/' rel='bookmark' title='Permanent Link: Updated Google Docs Drawing'>Updated Google Docs Drawing</a></li>
<li><a href='http://binpoint.com/2008/06/i-sure-miss-grep-in-m-windows/' rel='bookmark' title='Permanent Link: I sure miss grep in M$ Windows'>I sure miss grep in M$ Windows</a></li>
<li><a href='http://binpoint.com/2008/07/alltop/' rel='bookmark' title='Permanent Link: alltop'>alltop</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style="text-align:center;"><img src="http://binpoint.com/wp-content/uploads/2009/11/chromeOS.png" alt="chromeOS.png" border="0" width="442" height="114" /></div>
<p>Google&#8217;s Chrome OS project, first announced in July, will become available for download within a week, we&#8217;ve heard from a reliable source. Google previously said to expect an early version of the OS in the fall. </p>
<p>(Via <a href="http://www.linux.com/news/software">Linux.com :: Features</a>.)</p>


<p>Related posts:<ol><li><a href='http://binpoint.com/2010/05/updated-google-docs-drawing/' rel='bookmark' title='Permanent Link: Updated Google Docs Drawing'>Updated Google Docs Drawing</a></li>
<li><a href='http://binpoint.com/2008/06/i-sure-miss-grep-in-m-windows/' rel='bookmark' title='Permanent Link: I sure miss grep in M$ Windows'>I sure miss grep in M$ Windows</a></li>
<li><a href='http://binpoint.com/2008/07/alltop/' rel='bookmark' title='Permanent Link: alltop'>alltop</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://binpoint.com/2009/11/google-chrome-os-to-launch-within-a-week/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AUC #2: ls</title>
		<link>http://binpoint.com/2009/05/auc-2-ls/</link>
		<comments>http://binpoint.com/2009/05/auc-2-ls/#comments</comments>
		<pubDate>Tue, 05 May 2009 00:30:12 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Arb Unix Cmds]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[ls]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://binpoint.com/?p=429</guid>
		<description><![CDATA[AUC 2 &#8211; Arbitrary Unix Command #2 I thought it might be useful to cover some obscure unix commands that you may find useful in your day to day system administration. My primary work machine is a Macbook Pro these days, so I&#8217;ll lean towards cover commands that come with OS X. Most unix operating [...]


Related posts:<ol><li><a href='http://binpoint.com/2009/03/auc-1-paste/' rel='bookmark' title='Permanent Link: AUC #1: paste'>AUC #1: paste</a></li>
<li><a href='http://binpoint.com/2009/03/complete-unix-cron-job-crib-sheet/' rel='bookmark' title='Permanent Link: Complete Unix Cron Job Crib Sheet'>Complete Unix Cron Job Crib Sheet</a></li>
<li><a href='http://binpoint.com/2010/06/quick-note-on-sorting-john-pot-files/' rel='bookmark' title='Permanent Link: Quick note on sorting john.pot files'>Quick note on sorting john.pot files</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong><img class="alignleft size-full wp-image-342" style="margin: 5px;" title="auc2" src="http://binpoint.com/wp-content/uploads/2009/03/auc2.png" alt="auc2" width="190" height="114" />AUC 2 &#8211; Arbitrary Unix Command #2</strong><br />
I thought it might be useful to cover some obscure unix commands that you may find useful in your day to day system administration. My primary work machine is a Macbook Pro these days, so I&#8217;ll lean towards cover commands that come with OS X. Most unix operating systems will likely have the commands I cover.</p>
<p><span id="more-429"></span>Today I wanted to talk about a command that we use every day: ls. Yes, this isn&#8217;t a very arbitrary pick, but I decided sharing useful commands to be more important than obscure.</p>
<p>If you aren&#8217;t a regular unix user, the command &#8216;ls&#8217; is equivalent to the Windows &#8216;dir&#8217; command when using cmd.exe.</p>
<p><img class="size-full wp-image-431 alignnone" title="uac2-a" src="http://binpoint.com/wp-content/uploads/2009/05/uac2-a.jpg" alt="uac2-a" width="385" height="103" /></p>
<p>It is so frequently used that nearly 10% of my bash history contains &#8216;ls&#8217;. When considering the unix mantra that every command should do only one thing, but do it well, ls is surprisingly robust.</p>
<p><img class="alignnone size-full wp-image-432" title="auc2-b" src="http://binpoint.com/wp-content/uploads/2009/05/auc2-b.jpg" alt="auc2-b" width="508" height="213" /></p>
<p>While you may be quite familiar with this command, I always recommend checking the man page for a unix command as command switches may differ depending on your system (ie: gnu commands) and more importantly you may learn something new and useful. You can do so by typing:</p>
<blockquote><p>man ls</p></blockquote>
<p><img class="alignnone size-full wp-image-433" title="auc2-c" src="http://binpoint.com/wp-content/uploads/2009/05/auc2-c.jpg" alt="auc2-c" width="501" height="278" /></p>
<p>This should look familiar. The <em>-l</em> switch produces a vertical list (just like <em>dir /p </em>in cmd.exe.) The <em>-a</em> switch includes hidden files, which are typically preceded by a period. I won&#8217;t go into detail on how to read the permissions as the internet has many such <a href="http://en.wikipedia.org/wiki/File_system_permissions#Notation_of_traditional_Unix_permissions" target="_blank">guides</a>.</p>
<p><img class="alignnone size-full wp-image-434" title="auc2-d" src="http://binpoint.com/wp-content/uploads/2009/05/auc2-d.jpg" alt="auc2-d" width="156" height="229" /></p>
<p>Lets say you are interested in only file names of a particular directory. The <em>-1</em> switch will declutter the output quite nicely and only spit out a list of filenames and not any of the meta information such as file permissions, file ownership, size, and last file modify time.</p>
<p><img class="alignnone size-full wp-image-435" title="auc2-e" src="http://binpoint.com/wp-content/uploads/2009/05/auc2-e.jpg" alt="auc2-e" width="500" height="196" /></p>
<p>Ok. So what? Perhaps you are interested in performing a command against every file (not directory) in your current working directory. The first of the two commands above produces a single line of output, space delimited list of filenames. (I have see Internet postings frowning upon the use of <em>xargs</em> to convert newlines into spaces as I have, but still need to discover a better way.)</p>
<p>The second command builds upon the first by embedding it in backticks (usually shared with the tilde key) in use with a <em>for</em> loop. The command string inside the backticks is executed first and produces a space seperated list for the <em>x</em> variable in the <em>for</em> loop to iterate through. The result is a copy and paste-able start for a bash script. I&#8217;ve used the <em>head</em> command here as a placeholder example.</p>
<p><img class="alignnone size-full wp-image-436" title="auc2-f" src="http://binpoint.com/wp-content/uploads/2009/05/auc2-f.jpg" alt="auc2-f" width="157" height="305" /></p>
<p>Another useful application of <em>ls</em> is to produce a full, recursive directory listing.</p>
<p><img class="alignnone size-full wp-image-437" title="auc2-g" src="http://binpoint.com/wp-content/uploads/2009/05/auc2-g.jpg" alt="auc2-g" width="500" height="226" /></p>
<p>Saving the best for last is my favorite <em>ls</em> command. The <em>-t</em> switch sorts by modify time, newest at top and the <em>-r</em> switch reverses the order. This is the perfect way to quickly find your recent files. It&#8217;s such a time saver, I rarely use <em>ls -al</em> anymore in favor of the above.</p>
<p>Until next time!</p>


<p>Related posts:<ol><li><a href='http://binpoint.com/2009/03/auc-1-paste/' rel='bookmark' title='Permanent Link: AUC #1: paste'>AUC #1: paste</a></li>
<li><a href='http://binpoint.com/2009/03/complete-unix-cron-job-crib-sheet/' rel='bookmark' title='Permanent Link: Complete Unix Cron Job Crib Sheet'>Complete Unix Cron Job Crib Sheet</a></li>
<li><a href='http://binpoint.com/2010/06/quick-note-on-sorting-john-pot-files/' rel='bookmark' title='Permanent Link: Quick note on sorting john.pot files'>Quick note on sorting john.pot files</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://binpoint.com/2009/05/auc-2-ls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LCD on the Wall, Which Netbook Battery Lasts the Longest of Them All?</title>
		<link>http://binpoint.com/2009/04/longest-netbook-battery-life/</link>
		<comments>http://binpoint.com/2009/04/longest-netbook-battery-life/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 20:32:41 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[Toys]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://binpoint.com/?p=346</guid>
		<description><![CDATA[On the hunt for a travel netbook? After testing out early models with squished keyboards I decided to wait for a model with useable size and 10&#8243; seems to be about perfect. I originally thought I wanted a fully loaded netbook until I realized that wasn&#8217;t the point. Netbooks are not intended to replace laptops. [...]


Related posts:<ol><li><a href='http://binpoint.com/2009/01/dell-mini-10-my-next-toy-purchase/' rel='bookmark' title='Permanent Link: Dell Mini 10 &#8211; My Next Toy Purchase'>Dell Mini 10 &#8211; My Next Toy Purchase</a></li>
<li><a href='http://binpoint.com/2009/12/a-romance-flowchart-when-is-it-inappropriate-to-use-your-iphone/' rel='bookmark' title='Permanent Link: A Romance Flowchart: When Is It Inappropriate to Use Your iPhone?'>A Romance Flowchart: When Is It Inappropriate to Use Your iPhone?</a></li>
<li><a href='http://binpoint.com/2009/11/study-indicates-macbooks-are-pretty-reliable/' rel='bookmark' title='Permanent Link: Study indicates MacBooks are pretty reliable'>Study indicates MacBooks are pretty reliable</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-349" title="batteries_netbook" src="http://binpoint.com/wp-content/uploads/2009/04/batterie_netbook-150x112.jpg" alt="batteries_netbook" width="150" height="112" /></p>
<p>On the hunt for a travel <a href="http://en.wikipedia.org/wiki/Netbook" target="_blank">netbook</a>? After testing out early models with squished keyboards I decided to wait for a model with useable size and 10&#8243; seems to be about perfect. I originally thought I wanted a fully loaded netbook until I realized that wasn&#8217;t the point. Netbooks are <em>not</em> intended to replace laptops. They <em>are</em> intended to be ultra portable with prices making them nearly disposable. Netbooks are perfect travel companions for photographers who need to dump the days pictures onto a backup external hard drive and review images on a screen larger than the thumbnail preview on the back of their camera.</p>
<p>Since a unit&#8217;s size is an important feature, how much juice can you realistically expect from the form factor? Find the list of which models last the longest after the jump.</p>
<p><span id="more-346"></span>A recent article was posted with a chart of netbook battery life of popular netbook models. They identified the MSI Wind U115 Hybrid as the pack leader (thanks to it&#8217;s 6-cell battery and use of SSD hd to save power) however, other upcoming models that look promising such as the <a href="http://www.amazon.com/gp/product/B001O94FY8?ie=UTF8&amp;tag=binpoint-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001O94FY8">Samsung NC10</a>, the <a href="http://www.amazon.com/gp/product/B001QTXL82?ie=UTF8&amp;tag=binpoint-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001QTXL82">Asus 1000HE</a> (E for extended battery) and the <a href="http://www.dell.com/content/products/productdetails.aspx/laptop-inspiron-10?c=us&amp;cs=19&amp;l=en&amp;s=dhs" target="_blank">Dell Mini 10</a> were not tested.</p>
<table border="0">
<tbody>
<tr>
<th>Model</th>
<th>Life</th>
</tr>
<tr>
<td><a href="http://www.amazon.com/gp/product/B001O94FY8?ie=UTF8&amp;tag=binpoint-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B001O94FY8">Samsung NC10</a></td>
<td>N/A</td>
</tr>
<tr>
<td><a href="http://www.amazon.com/gp/product/B001QTXL82?ie=UTF8&#038;tag=binpoint-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B001QTXL82">Asus 1000HE</a></td>
<td>N/A</td>
</tr>
<tr>
<td>MSI Wind U115 Hybrid</td>
<td>6:56</td>
</tr>
<tr>
<td><a href="http://www.amazon.com/gp/product/B001GIPSAC?ie=UTF8&amp;tag=binpoint-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001GIPSAC">Asus Eee PC 1000HD</a></td>
<td>4:12</td>
</tr>
<tr>
<td><a href="http://www.amazon.com/gp/product/B001BYB61G?ie=UTF8&amp;tag=binpoint-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001BYB61G">Asus Eee PC 901</a></td>
<td>3:59</td>
</tr>
<tr>
<td><a href="http://www.amazon.com/gp/product/B001H0GEVG?ie=UTF8&amp;tag=binpoint-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001H0GEVG">MSI Wind U100</a></td>
<td>3:40</td>
</tr>
<tr>
<td><a href="http://www.amazon.com/gp/product/B001GIPSAC?ie=UTF8&amp;tag=binpoint-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001GIPSAC">Asus Eee PC 1000H</a></td>
<td>3:33</td>
</tr>
<tr>
<td><a href="http://www.amazon.com/gp/product/B001G17L18?ie=UTF8&amp;tag=binpoint-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001G17L18">Asus N10J</a></td>
<td>3:05</td>
</tr>
<tr>
<td><a href="http://www.dell.com/content/products/productdetails.aspx/laptop-inspiron-9?cs=19&amp;s=dhs&amp;ref=homepg" target="_blank">Dell Inspiron Mini 9</a></td>
<td>3:05</td>
</tr>
<tr>
<td><a href="http://www.amazon.com/gp/product/B001ISK2B0?ie=UTF8&amp;tag=binpoint-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001ISK2B0">Asus Eee PC S101</a></td>
<td>2:41</td>
</tr>
<tr>
<td><a href="http://www.amazon.com/gp/product/B001NMT51O?ie=UTF8&amp;tag=binpoint-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001NMT51O">Acer Aspire One AOA110</a></td>
<td>2:19</td>
</tr>
<tr>
<td>Toshiba NB100</td>
<td>2:14</td>
</tr>
<tr>
<td><a href="http://h10025.www1.hp.com/ewfrf/wc/prodinfoCategory?lc=en&amp;dlc=en&amp;cc=us&amp;product=3838214&amp;lang=en">HP Mini 1001TU</a></td>
<td>2:05</td>
</tr>
<tr>
<td><a href="http://www.amazon.com/gp/product/B001OO2SZQ?ie=UTF8&amp;tag=binpoint-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B001OO2SZQ">Lenovo IdeaPad S10</a></td>
<td>1:55</td>
</tr>
<tr>
<td><a href="http://www.dell.com/content/products/productdetails.aspx/laptop-inspiron-12?c=us&amp;l=en&amp;s=dhs&amp;cs=19">Dell Inspiron Mini 12</a></td>
<td>1:47</td>
</tr>
</tbody>
</table>
<p>It&#8217;s interesting to note how poor the Dell Mini 12 performed. The larger screen and higher resolution is likely to blame. This highlights an important decision future netbook buyers will need to consider: Longer battery life or a better looking screen?</p>
<p>[<a href="http://netbookreview.darrenyates.com.au/?p=329" target="_blank">LINK</a>]</p>


<p>Related posts:<ol><li><a href='http://binpoint.com/2009/01/dell-mini-10-my-next-toy-purchase/' rel='bookmark' title='Permanent Link: Dell Mini 10 &#8211; My Next Toy Purchase'>Dell Mini 10 &#8211; My Next Toy Purchase</a></li>
<li><a href='http://binpoint.com/2009/12/a-romance-flowchart-when-is-it-inappropriate-to-use-your-iphone/' rel='bookmark' title='Permanent Link: A Romance Flowchart: When Is It Inappropriate to Use Your iPhone?'>A Romance Flowchart: When Is It Inappropriate to Use Your iPhone?</a></li>
<li><a href='http://binpoint.com/2009/11/study-indicates-macbooks-are-pretty-reliable/' rel='bookmark' title='Permanent Link: Study indicates MacBooks are pretty reliable'>Study indicates MacBooks are pretty reliable</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://binpoint.com/2009/04/longest-netbook-battery-life/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AUC #1: paste</title>
		<link>http://binpoint.com/2009/03/auc-1-paste/</link>
		<comments>http://binpoint.com/2009/03/auc-1-paste/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 00:23:34 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Arb Unix Cmds]]></category>

		<guid isPermaLink="false">http://binpoint.com/2009/03/auc-1-paste/</guid>
		<description><![CDATA[AUC 1 &#8211; Arbitrary Unix Command #1 I thought it might be useful to cover some obscure unix commands that you may find useful in your day to day system administration. My primary work machine is a Macbook Pro these days, so I&#8217;ll lean towards cover commands that come with OS X. Most unix operating [...]


Related posts:<ol><li><a href='http://binpoint.com/2009/05/auc-2-ls/' rel='bookmark' title='Permanent Link: AUC #2: ls'>AUC #2: ls</a></li>
<li><a href='http://binpoint.com/2009/03/complete-unix-cron-job-crib-sheet/' rel='bookmark' title='Permanent Link: Complete Unix Cron Job Crib Sheet'>Complete Unix Cron Job Crib Sheet</a></li>
<li><a href='http://binpoint.com/2008/06/detectin-bad-tcp-sessions/' rel='bookmark' title='Permanent Link: Detecting bad TCP sessions'>Detecting bad TCP sessions</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong><img class="alignleft size-full wp-image-342" style="margin: 5px;" title="auc2" src="http://binpoint.com/wp-content/uploads/2009/03/auc2.png" alt="auc2" width="190" height="114" />AUC 1 &#8211; Arbitrary Unix Command #1</strong><br />
I thought it might be useful to cover some obscure unix commands that you may find useful in your day to day system administration. My primary work machine is a Macbook Pro these days, so I&#8217;ll lean towards cover commands that come with OS X. Most unix operating systems (OpenBSD, FreeBSD, Linux, Solaris) will likely have the commands I cover as well so only the Microsoft-only folks will be left out. (sorry)</p>
<p><span id="more-337"></span>Up first is the command that took my 15 minutes to remember at work today when I wanted to take a list with one column and seperate it into a list with two columns. Here, a visual will make this easier to explain:</p>
<p><img style="margin: 5px;" title="List of foo" src="http://binpoint.com/wp-content/uploads/2009/03/terminal-vim-8024.png" alt="List of foo" width="185" height="168" /></p>
<p>This is a list of a person and their favorite fruit. You want to convert this into a table like this:</p>
<p><img style="margin: 5px" title="Useful lookup table" src="http://binpoint.com/wp-content/uploads/2009/03/terminal-bash-8024.png" alt="Useful lookup table" /></p>
<p>But your table is 100,000 lines long and you don&#8217;t want to do it by hand, or mess with any complex regular expressions in sed, awk or a scripting language.</p>
<p>The unix command <em>paste </em>does exactly this. Here&#8217;s how simple the syntax is:</p>
<blockquote><p>cat 100k_file | paste &#8211; - &gt; lookup_table</p></blockquote>
<p>Now that&#8217;s pretty simple. Just change the number of &#8220;-&#8221;&#8216;s to how many columns you want.</p>
<p><em>paste</em> can do some other things but this is how I found it to be useful. If you have another tip on paste, the comment box below awaits.</p>


<p>Related posts:<ol><li><a href='http://binpoint.com/2009/05/auc-2-ls/' rel='bookmark' title='Permanent Link: AUC #2: ls'>AUC #2: ls</a></li>
<li><a href='http://binpoint.com/2009/03/complete-unix-cron-job-crib-sheet/' rel='bookmark' title='Permanent Link: Complete Unix Cron Job Crib Sheet'>Complete Unix Cron Job Crib Sheet</a></li>
<li><a href='http://binpoint.com/2008/06/detectin-bad-tcp-sessions/' rel='bookmark' title='Permanent Link: Detecting bad TCP sessions'>Detecting bad TCP sessions</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://binpoint.com/2009/03/auc-1-paste/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Source Mac</title>
		<link>http://binpoint.com/2009/03/open-source-mac/</link>
		<comments>http://binpoint.com/2009/03/open-source-mac/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 06:40:59 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://binpoint.com/?p=324</guid>
		<description><![CDATA[I recently stumbled upon this website (OpenSourceMac.org) which is a clean list of useful open source software that has been written or ported over to Apple OS X. This is very handy to email to your friend which you recently converted to Apple Related posts:Free OSX Tools I Use Everyday Writing a DNS sniffer iPhone: [...]


Related posts:<ol><li><a href='http://binpoint.com/2008/11/free-osx-tools-i-use-everyday/' rel='bookmark' title='Permanent Link: Free OSX Tools I Use Everyday'>Free OSX Tools I Use Everyday</a></li>
<li><a href='http://binpoint.com/2008/06/writing-a-dns-sniffer/' rel='bookmark' title='Permanent Link: Writing a DNS sniffer'>Writing a DNS sniffer</a></li>
<li><a href='http://binpoint.com/2010/02/iphone-harbinger-of-doomsday-malware/' rel='bookmark' title='Permanent Link: iPhone: Harbinger of Doomsday Malware'>iPhone: Harbinger of Doomsday Malware</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.opensourcemac.org/" target="_blank"><img class="alignnone size-medium wp-image-325" title="osmac" src="http://binpoint.com/wp-content/uploads/2009/03/osmac-300x246.png" alt="osmac" width="300" height="246" /></a></p>
<p>I recently <a href="http://stumbleupon.com" target="_blank">stumbled upon</a> this website (<a href="http://www.opensourcemac.org/" target="_blank">OpenSourceMac.org</a>) which is a clean list of useful open source software that has been written or ported over to Apple OS X. This is very handy to email to your friend which you recently converted to Apple <img src='http://binpoint.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://binpoint.com/2008/11/free-osx-tools-i-use-everyday/' rel='bookmark' title='Permanent Link: Free OSX Tools I Use Everyday'>Free OSX Tools I Use Everyday</a></li>
<li><a href='http://binpoint.com/2008/06/writing-a-dns-sniffer/' rel='bookmark' title='Permanent Link: Writing a DNS sniffer'>Writing a DNS sniffer</a></li>
<li><a href='http://binpoint.com/2010/02/iphone-harbinger-of-doomsday-malware/' rel='bookmark' title='Permanent Link: iPhone: Harbinger of Doomsday Malware'>iPhone: Harbinger of Doomsday Malware</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://binpoint.com/2009/03/open-source-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Complete Unix Cron Job Crib Sheet</title>
		<link>http://binpoint.com/2009/03/complete-unix-cron-job-crib-sheet/</link>
		<comments>http://binpoint.com/2009/03/complete-unix-cron-job-crib-sheet/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 03:30:19 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[crib sheet]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[cron job]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[easy]]></category>

		<guid isPermaLink="false">http://binpoint.com/?p=276</guid>
		<description><![CDATA[Do you only use unix once in a blue moon, need to setup crontab and can&#8217;t quite remember the order? (Without peeking at the image on the left) Try out this handy cron job crib sheet which you can paste directly into your crontab as a reference each time you make a scheduled job change. [...]


Related posts:<ol><li><a href='http://binpoint.com/2009/05/auc-2-ls/' rel='bookmark' title='Permanent Link: AUC #2: ls'>AUC #2: ls</a></li>
<li><a href='http://binpoint.com/2009/03/auc-1-paste/' rel='bookmark' title='Permanent Link: AUC #1: paste'>AUC #1: paste</a></li>
<li><a href='http://binpoint.com/2010/06/quick-note-on-sorting-john-pot-files/' rel='bookmark' title='Permanent Link: Quick note on sorting john.pot files'>Quick note on sorting john.pot files</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-277 alignleft" title="cron" src="http://binpoint.com/wp-content/uploads/2009/03/cron.png" alt="cron" width="320" height="98" />Do you only use unix once in a blue moon, need to setup crontab and can&#8217;t quite remember the order? (Without peeking at the image on the left)<br />
Try out this handy cron job crib sheet which you can paste directly into your crontab as a reference each time you make a scheduled job change.</p>
<p><span id="more-276"></span>Cron is a unix program that is used to automatically run commands or scripts at predetermined times. Common uses include running nightly backups, log searching or other system resource intensive tasks when everyone is at home sleeping. Each unix user has their own crontab list. If you are new to scheduling tasks in Sun Solaris, Red Hat Enterprise Linux, Fedora, Ubuntu, Debian OS X, FreeBSD or any other flavor of unix, the following quick cron guide should help.</p>
<p>To check what is currently scheduled for execution for one user, open a terminal and type:</p>
<pre>crontab -l -u &lt;username&gt;</pre>
<p>Any task that requires root privileges will need to be put in the root uer&#8217;s crontab. Let&#8217;s add a simple backup scheduled task as an example. To open the cron file as the root user with your default text editor, type:</p>
<pre>sudo crontab -e</pre>
<p>At the top of the crontab file (or if it is empty) paste in the following:</p>
<pre># +- - - - - - minute [0-59]   | Special Entries: @reboot, @yearly, @monthly,
# | +- - - - - hour [0-23]     |                  @weekly, @midnight, @hourly
# | | +- - - - monthday [1-31]  ---------------------------------------------
# | | | +- - - month [1-12, jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec]
# | | | | +- - weekday [0-6, sun,mon,tue,wed,thu,fri,sat,sun]
# * * * * * /full/path/to/command args &gt;&gt; ~/command.log</pre>
<p>This Crib Sheet will serve as a crontab syntax reference every time you list or edit the crontab but won&#8217;t be interpreted by cron since each line starts with a poundsign (<em>#</em>) character indicating a comment line. The first five columns allow you to define the minutes, hours, days of the month, months, and weekdays that you want your job to run. The sixth column is the command or script to execute at the appointed time or times.</p>
<p>Here&#8217;s an example crontab line that runs the backup.sh script every twenty minutes on April 13th, 14th and 15th:</p>
<pre>0,20,40 * 13-15 4 * /home/tom/scripts/backup.sh &gt;&gt; /var/log/backups.log</pre>
<p>The last part may look new if you are unfamiliar with pipes. The double greaterthan signs will append the output of backup.sh into a file called backups.log located in the /var/log/ directory. While you can chain together many unix commands directly in the crontab file, I recommend using a separate file (ie: in your scripts directory) to perform more complicated tasks.</p>
<p>Here&#8217;s another cron job example that searches for files in anyones home directory modified in the last 24 hours and puts a report in your home directory:</p>
<pre>0 1 * * * /usr/bin/find /home -mtime -1 -type f -exec ls -lh {} \; &gt; \
/home/tom/new_files_report_`date +%Y-%m-%d`.txt</pre>
<p>Hope that helps! Comments welcome.</p>


<p>Related posts:<ol><li><a href='http://binpoint.com/2009/05/auc-2-ls/' rel='bookmark' title='Permanent Link: AUC #2: ls'>AUC #2: ls</a></li>
<li><a href='http://binpoint.com/2009/03/auc-1-paste/' rel='bookmark' title='Permanent Link: AUC #1: paste'>AUC #1: paste</a></li>
<li><a href='http://binpoint.com/2010/06/quick-note-on-sorting-john-pot-files/' rel='bookmark' title='Permanent Link: Quick note on sorting john.pot files'>Quick note on sorting john.pot files</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://binpoint.com/2009/03/complete-unix-cron-job-crib-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMWare Headed to a Smartphone Near You</title>
		<link>http://binpoint.com/2009/02/vmware-headed-to-a-smartphone-near-you/</link>
		<comments>http://binpoint.com/2009/02/vmware-headed-to-a-smartphone-near-you/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 18:28:14 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Pretty]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://binpoint.com/?p=224</guid>
		<description><![CDATA[AWESOME (Clicky!) Related posts:I sure miss grep in M$ Windows A Romance Flowchart: When Is It Inappropriate to Use Your iPhone? Pretty graphs for the malware detection (ftw?)


Related posts:<ol><li><a href='http://binpoint.com/2008/06/i-sure-miss-grep-in-m-windows/' rel='bookmark' title='Permanent Link: I sure miss grep in M$ Windows'>I sure miss grep in M$ Windows</a></li>
<li><a href='http://binpoint.com/2009/12/a-romance-flowchart-when-is-it-inappropriate-to-use-your-iphone/' rel='bookmark' title='Permanent Link: A Romance Flowchart: When Is It Inappropriate to Use Your iPhone?'>A Romance Flowchart: When Is It Inappropriate to Use Your iPhone?</a></li>
<li><a href='http://binpoint.com/2008/06/pretty-graphs-for-the-malware-detection-ftw/' rel='bookmark' title='Permanent Link: Pretty graphs for the malware detection (ftw?)'>Pretty graphs for the malware detection (ftw?)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://i.gizmodo.com/5160685/vmware-for-mobile-devices-lets-you-run-windows-and-android-simultaneously">AWESOME</a> (Clicky!)</p>


<p>Related posts:<ol><li><a href='http://binpoint.com/2008/06/i-sure-miss-grep-in-m-windows/' rel='bookmark' title='Permanent Link: I sure miss grep in M$ Windows'>I sure miss grep in M$ Windows</a></li>
<li><a href='http://binpoint.com/2009/12/a-romance-flowchart-when-is-it-inappropriate-to-use-your-iphone/' rel='bookmark' title='Permanent Link: A Romance Flowchart: When Is It Inappropriate to Use Your iPhone?'>A Romance Flowchart: When Is It Inappropriate to Use Your iPhone?</a></li>
<li><a href='http://binpoint.com/2008/06/pretty-graphs-for-the-malware-detection-ftw/' rel='bookmark' title='Permanent Link: Pretty graphs for the malware detection (ftw?)'>Pretty graphs for the malware detection (ftw?)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://binpoint.com/2009/02/vmware-headed-to-a-smartphone-near-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
