<?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>MrBrown blob &#187; Command line</title>
	<atom:link href="http://charles.lescampeurs.org/category/command-line/feed" rel="self" type="application/rss+xml" />
	<link>http://charles.lescampeurs.org</link>
	<description>random bits.</description>
	<lastBuildDate>Sat, 10 Apr 2010 09:02:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Find and remove files</title>
		<link>http://charles.lescampeurs.org/2010/02/04/find-and-remove-files</link>
		<comments>http://charles.lescampeurs.org/2010/02/04/find-and-remove-files#comments</comments>
		<pubDate>Thu, 04 Feb 2010 09:36:29 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[find]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=215</guid>
		<description><![CDATA[I regularly use the find command in scripts to clean directories on my servers. The common way to use find to do this is to write something like: find ./my_dir -name 'cache-*' -exec rm -rf \{\} \; It works fine but it always outputs messages like this: find: ./mydir/cache-001: No such file or director which [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2010%2F02%2F04%2Ffind-and-remove-files"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2010%2F02%2F04%2Ffind-and-remove-files&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I regularly use the find command in scripts to clean directories on my servers.<br /> The common way to use find to do this is to write something like:</p>
<pre>find ./my_dir -name 'cache-*' -exec rm -rf \{\} \;</pre>
<p>It works fine but it always outputs messages like this:</p>
<pre>find: ./mydir/cache-001: No such file or director</pre>
<p>which can be annoying when ran in a crontab.</p>
<p>I just found recently that using the option &#8216;-delete&#8217; with find just fix this problem.</p>
<pre>find ./my_dir -name 'cache-*' -delete</pre>
<p> </p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2010/02/04/find-and-remove-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quickly check hosts with ping</title>
		<link>http://charles.lescampeurs.org/2009/08/14/quickly-check-hosts-with-ping</link>
		<comments>http://charles.lescampeurs.org/2009/08/14/quickly-check-hosts-with-ping#comments</comments>
		<pubDate>Fri, 14 Aug 2009 11:46:02 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[netcat]]></category>
		<category><![CDATA[ping]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=198</guid>
		<description><![CDATA[I needed a script for a quick health check of a bunch of servers. This is how I did it using the ping command: for((i=1;i&#60;42;i++)); do ping -c 1 -W 3 host${i}.domain.com &#38;&#62; /dev/null if [ $? -ne 0 ] ; then echo "host${i} is down" else echo "host${i} is up" fi done You can [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2009%2F08%2F14%2Fquickly-check-hosts-with-ping"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2009%2F08%2F14%2Fquickly-check-hosts-with-ping&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I needed a script for a quick health check of a bunch of servers.<br />
This is how I did it using the <a href="http://linux.die.net/man/8/ping" target="_blank">ping command</a>:</p>
<pre>for((i=1;i&lt;42;i++)); do
    ping -c 1 -W 3 host${i}.domain.com &amp;&gt; /dev/null
    if [ $? -ne 0 ] ; then
        echo "host${i} is down"
    else
        echo "host${i} is up"
    fi
done</pre>
<p>You can also use netcat and check a specific port:</p>
<pre>netcat -z -w 2  host${i}.domain.com 80 &amp;&gt; /dev/null</pre>
]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2009/08/14/quickly-check-hosts-with-ping/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Set Terminal tab title in Mac OS X</title>
		<link>http://charles.lescampeurs.org/2009/08/11/set-terminal-tab-title-in-mac-os-x</link>
		<comments>http://charles.lescampeurs.org/2009/08/11/set-terminal-tab-title-in-mac-os-x#comments</comments>
		<pubDate>Tue, 11 Aug 2009 12:12:07 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=195</guid>
		<description><![CDATA[I wrote previously a how-to to set your iTerm tab title. I finally found a tool to do the same thing with the default Mac OS X Terminal. Check it out here, it works perfectly for me!]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2009%2F08%2F11%2Fset-terminal-tab-title-in-mac-os-x"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2009%2F08%2F11%2Fset-terminal-tab-title-in-mac-os-x&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="aligncenter size-full wp-image-196" title="Picture 2" src="http://charles.lescampeurs.org/wp-content/uploads/2009/08/Picture-2.png" alt="Picture 2" width="209" height="84" /></p>
<p>I wrote previously a how-to to <a href="http://charles.lescampeurs.org/2008/05/07/automatically-set-title-on-iterm-tabs" target="_blank">set your iTerm tab title</a>.</p>
<p>I finally found a tool to do the same thing with the default Mac OS X Terminal.</p>
<p>Check it out <a href="http://purpleamy.com/magicwrap/" target="_blank">here</a>, it works perfectly for me!</p>
]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2009/08/11/set-terminal-tab-title-in-mac-os-x/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Finding the total size of a set of files with awk</title>
		<link>http://charles.lescampeurs.org/2009/04/17/finding-the-total-size-of-a-set-of-files-with-awk</link>
		<comments>http://charles.lescampeurs.org/2009/04/17/finding-the-total-size-of-a-set-of-files-with-awk#comments</comments>
		<pubDate>Fri, 17 Apr 2009 09:12:22 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[awk]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=185</guid>
		<description><![CDATA[If you need to sum the total size of files in a directory or matching a pattern, an easy solution is to use awk. I needed to calculate this total for a set of javascript files, I used this command line: $ find App/ -name '*.js' -exec ls -l \{\} \; &#124; awk '{sum+=$5} END [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2009%2F04%2F17%2Ffinding-the-total-size-of-a-set-of-files-with-awk"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2009%2F04%2F17%2Ffinding-the-total-size-of-a-set-of-files-with-awk&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you need to sum the total size of files in a directory or matching a pattern, an easy solution is to use <em>awk</em>.</p>
<p>I needed to calculate this total for a set of javascript files, I used this command line:</p>
<pre>$ find App/ -name '*.js' -exec ls -l \{\} \; | awk '{sum+=$5} END {print sum}'
1929403</pre>
<p>For a human readable result, you can divide your result and use printf to format it:</p>
<pre>$ find App/ -name '*.js' -exec ls -l \{\} \; | awk '{sum+=$5} END {printf("%.2fM\n", sum/1024/1024)}'
1.84M</pre>
]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2009/04/17/finding-the-total-size-of-a-set-of-files-with-awk/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Memory usage by group of processes</title>
		<link>http://charles.lescampeurs.org/2009/03/13/memory-usage-by-group-of-processes</link>
		<comments>http://charles.lescampeurs.org/2009/03/13/memory-usage-by-group-of-processes#comments</comments>
		<pubDate>Fri, 13 Mar 2009 14:14:26 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Benchmarks]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=173</guid>
		<description><![CDATA[While monitoring a http/php server, I needed to do some statistics about php-cgi memory usage. Playing with memory_limit in PHP, we wanted to know the average memory usage per php-cgi process. This is easily calculated with our best friend awk. First, get the number of php running processes: # ps aux &#124; grep php-cgi &#124; [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2009%2F03%2F13%2Fmemory-usage-by-group-of-processes"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2009%2F03%2F13%2Fmemory-usage-by-group-of-processes&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>While monitoring a http/php server, I needed to do some statistics about php-cgi memory usage.</p>
<p>Playing with <em>memory_limit</em> in PHP, we wanted to know the average memory usage per php-cgi process. This is easily calculated with our best friend awk.</p>
<p>First, get the number of php running processes:</p>
<pre># ps aux | grep php-cgi | grep -v grep | wc -l
126</pre>
<p>Then, use awk to calculate the average memory usage for these processes:</p>
<pre># ps aux | grep --exclude=grep php-cgi | grep -v grep | awk 'BEGIN{s=0;}{s=s+$6;}END{print s/126;}'
33987.8</pre>
<p>The number used in the calculation is the field RSS given by ps. The ps manual page says:</p>
<blockquote><p>rss: resident set size, the non-swapped physical memory that a task has used (in kiloBytes)</p></blockquote>
<p>You can also calculate the total memory used by all php-cgi processes:</p>
<pre># ps aux | grep --exclude=grep php-cgi | grep -v grep | awk 'BEGIN{s=0;}{s=s+$6;}END{print s;}'
4302028</pre>
<p>If you need to watch the trend of this average memory usage, a little shell loop does the trick:</p>
<pre># while [ 1 ]; do ps aux | grep --exclude=grep php-cgi | grep -v grep | awk 'BEGIN{s=0;}{s=s+$6;}END{print s/126;}'; sleep 2; done
34401.3
34405.1
34408.4
34409.4
34414.2
34417</pre>
]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2009/03/13/memory-usage-by-group-of-processes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The unix touch command</title>
		<link>http://charles.lescampeurs.org/2008/09/11/the-unix-touch-command</link>
		<comments>http://charles.lescampeurs.org/2008/09/11/the-unix-touch-command#comments</comments>
		<pubDate>Thu, 11 Sep 2008 05:30:19 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[coretutils]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=53</guid>
		<description><![CDATA[This post is a quick ref on the linux touch command. All the examples have been tested on Linux. This command is used to update the access and modification times of files. touch&#8217;s syntax touch [option] file_name(s) touch file1 file2 file3 Here some examples: # touch /tmp/file # ls -l /tmp/file rw-r--r-- 1 charlybr charlybr [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F09%2F11%2Fthe-unix-touch-command"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F09%2F11%2Fthe-unix-touch-command&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>This post is a quick ref on the linux touch command. All the examples have been tested on Linux.</p>
<p>This command is used to update the access and modification times of files.</p>
<ul>
<li>touch&#8217;s syntax</li>
</ul>
<pre>touch [option] file_name(s)
touch file1 file2 file3</pre>
<ul>
<li>Here some examples:</li>
</ul>
<pre># touch /tmp/file
# ls -l /tmp/file
rw-r--r-- 1 charlybr charlybr 0 Sep 10 16:13 /tmp/file</pre>
<ul>
<li>Update access and modification time to current time:</li>
</ul>
<pre># ls -l /tmp/file
rw-r--r-- 1 charlybr charlybr 0 Sep 10 16:13 /tmp/file
# touch /tmp/file
# ls -l /tmp/file
rw-r--r-- 1 charlybr charlybr 0 Sep 10 16:14 /tmp/file</pre>
<ul>
<li>Update access and modification time to a specified timestamp ([[CC]YY]MMDDhhmm[.ss] format):</li>
</ul>
<pre># touch -t 09091842 /tmp/file
# ls -l /tmp/file
-rw-r--r-- 1 charlybr charlybr 0 Sep  9 18:42 /tmp/file</pre>
<ul>
<li>Update access and modification time to a specified date</li>
</ul>
<pre># touch -d '9 Sep' /tmp/file
# ls -l /tmp/file
-rw-r--r-- 1 charlybr charlybr 0 Sep  9 00:00 /tmp/file
# touch -d '9 Sep 2008 13:14' /tmp/file
# ls -l /tmp/file
-rw-r--r-- 1 charlybr charlybr 0 Sep  9 13:14 /tmp/file</pre>
<h2>Links</h2>
<ul>
<li>touch is part of the <a title="Coreutils package" href="http://www.gnu.org/software/coreutils/" target="_blank">Coreutils</a> package</li>
<li><a title="touch documentation page" href="http://www.gnu.org/software/coreutils/manual/html_node/touch-invocation.html#touch-invocation" target="_blank">touch documentation page</a></li>
<li><a title="touch man page on FreeBSD" href="http://www.freebsd.org/cgi/man.cgi?query=touch&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+7.0-RELEASE&amp;format=html" target="_blank">man page on FreeBSD</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/09/11/the-unix-touch-command/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Retrieve file from svn</title>
		<link>http://charles.lescampeurs.org/2008/05/23/retrieve-file-from-svn</link>
		<comments>http://charles.lescampeurs.org/2008/05/23/retrieve-file-from-svn#comments</comments>
		<pubDate>Fri, 23 May 2008 05:51:31 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=17</guid>
		<description><![CDATA[Sometimes you need to retrieve a single file from SVN without doing a checkout on the repository. SVN provides the svn cat to output the content of a file. You can redirect the output to get the file as : svn cat https://svn.mydomain.com/project/folder/file.ext &#62; file.ext You can also use a simple shell script to do [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F05%2F23%2Fretrieve-file-from-svn"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F05%2F23%2Fretrieve-file-from-svn&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Sometimes you need to retrieve a single file from SVN without doing a checkout on the repository.</p>
<p>SVN provides the <a title="svn cat command" href="http://svnbook.red-bean.com/en/1.4/svn.ref.svn.c.cat.html" target="_blank">svn cat</a> to output the content of a file. You can redirect the output to get the file as :</p>
<pre>svn cat https://svn.mydomain.com/project/folder/file.ext &gt; file.ext</pre>
<p>You can also use a simple shell script to do the work :</p>
<pre>$ cat svnget</pre>
<pre>#!/bin/sh

if [ -z "$1" ]; then
        echo
        echo "Usage : $0 &lt;SVN-URL&gt;"
        echo
        exit
fi

fn=`basename $1`
svn cat $1 &gt; $fn</pre>
]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/05/23/retrieve-file-from-svn/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically set title on iTerm tabs</title>
		<link>http://charles.lescampeurs.org/2008/05/07/automatically-set-title-on-iterm-tabs</link>
		<comments>http://charles.lescampeurs.org/2008/05/07/automatically-set-title-on-iterm-tabs#comments</comments>
		<pubDate>Wed, 07 May 2008 12:10:53 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[iTerm]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=11</guid>
		<description><![CDATA[If like me you use iTerm for your terminal sessions, this is the tips to dynamically set the tab title. As I&#8217;m using the bash shell, the tab title can be automatically set with the PROMPT_COMMAND variable. You can set this variable in /etc/profile or in your .bashrc Mine is like this : export PROMPT_COMMAND=&#8217;echo [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F05%2F07%2Fautomatically-set-title-on-iterm-tabs"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F05%2F07%2Fautomatically-set-title-on-iterm-tabs&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: center;"><a href="http://charles.lescampeurs.org/wp-content/uploads/2008/05/picture-1.png"><img class="size-full wp-image-12" title="iTerm tabs title" src="http://charles.lescampeurs.org/wp-content/uploads/2008/05/picture-1.png" alt="" width="361" height="135" /></a></p>
<p>If like me you use <a title="iTerm.app" href="http://iterm.sourceforge.net/" target="_blank">iTerm</a> for your terminal sessions, this is the tips to dynamically set the tab title.</p>
<p>As I&#8217;m using the bash shell, the tab title can be automatically set with the <tt>PROMPT_COMMAND</tt> variable. You can set this variable in <tt>/etc/profile</tt> or in your <tt>.bashrc</tt></p>
<p>Mine is like this :</p>
<p>export PROMPT_COMMAND=&#8217;echo -ne &#8220;\033]0;${USER}@${HOSTNAME%%.*}\007&#8243;&#8216;</p>
<p>The content of the variable is executed each time bash prints your prompt. Here echo is executed with the escape sequence to set the term title.</p>
<h2>More informations</h2>
<p>Some readings about this subject :</p>
<ul>
<li><a href="http://xanana.ucsc.edu/xtal/iterm_tab_customization.html" target="_blank">iTerm Shell Customizations for bash, zsh and tcsh</a></li>
<li><a href="http://www.faqs.org/docs/Linux-HOWTO/Bash-Prompt-HOWTO.html" target="_blank">an old Bash prompt HOWTO</a></li>
<li><a href="http://www.gnu.org/software/bash/" target="_blank">Bash Homepage</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/05/07/automatically-set-title-on-iterm-tabs/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Command line history</title>
		<link>http://charles.lescampeurs.org/2008/05/02/command-line-history</link>
		<comments>http://charles.lescampeurs.org/2008/05/02/command-line-history#comments</comments>
		<pubDate>Fri, 02 May 2008 15:54:28 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[history]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=3</guid>
		<description><![CDATA[As read here, this is my command line history on my MacBook : $ history 1000 &#124; awk '{a[$2]++}END{for(i in a){print a[i] &#34; &#34; i}}' &#124; sort -rn &#124; head 240 ssh 62 cd 55 scp 33 for 28 vim 25 ping 17 history 13 ls 4 sudo 3 telnet]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F05%2F02%2Fcommand-line-history"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F05%2F02%2Fcommand-line-history&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>As read <a href="http://blog.kovyrin.net/2008/04/28/command-line-history/" target="_blank">here</a>, this is my command line history on my MacBook :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #7a0874; font-weight: bold;">history</span> <span style="color: #000000;">1000</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{a[$2]++}END{for(i in a){print a[i] &quot; &quot; i}}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-rn</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">head</span></div></div>
<p><tt></p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">240</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span><br />
<span style="color: #000000;">62</span> <span style="color: #7a0874; font-weight: bold;">cd</span><br />
<span style="color: #000000;">55</span> <span style="color: #c20cb9; font-weight: bold;">scp</span><br />
<span style="color: #000000;">33</span> <span style="color: #000000; font-weight: bold;">for</span><br />
<span style="color: #000000;">28</span> <span style="color: #c20cb9; font-weight: bold;">vim</span><br />
<span style="color: #000000;">25</span> <span style="color: #c20cb9; font-weight: bold;">ping</span><br />
<span style="color: #000000;">17</span> <span style="color: #7a0874; font-weight: bold;">history</span><br />
<span style="color: #000000;">13</span> <span style="color: #c20cb9; font-weight: bold;">ls</span><br />
<span style="color: #000000;">4</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span><br />
<span style="color: #000000;">3</span> telnet</div></div>
<p></tt></p>
]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/05/02/command-line-history/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
