<?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>Tuts4Tech &#187; shell</title>
	<atom:link href="http://tuts4tech.net/tag/shell/feed/" rel="self" type="application/rss+xml" />
	<link>http://tuts4tech.net</link>
	<description>Tech Tutorials</description>
	<lastBuildDate>Sun, 18 Jul 2010 01:41:08 +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>Howto Add time And Date To Your Bash History</title>
		<link>http://tuts4tech.net/2009/08/12/howto-add-time-and-date-to-your-bash-history/</link>
		<comments>http://tuts4tech.net/2009/08/12/howto-add-time-and-date-to-your-bash-history/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 13:00:27 +0000</pubDate>
		<dc:creator>Duffy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[searching]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://tuts4tech.net/?p=547</guid>
		<description><![CDATA[This comes in very handy if your trying to track back when you had last run something. To enable it just simply add export HISTTIMEFORMAT="%h/%d - %H:%M:%S " to your .bashrc file echo 'export HISTTIMEFORMAT=&#34;%h/%d - %H:%M:%S &#34;' &#62;&#62; ~/.bashrc Then reload your .bashrc source ~/.bashrc Now when you run history you should get a [...]]]></description>
			<content:encoded><![CDATA[<p>This comes in very handy if your trying to track back when you had last run something.<br />
To enable it just simply add export HISTTIMEFORMAT="%h/%d - %H:%M:%S " to your .bashrc file
<pre class="brush: plain;">echo 'export HISTTIMEFORMAT=&quot;%h/%d - %H:%M:%S &quot;' &gt;&gt; ~/.bashrc</pre>
<p>
Then reload your .bashrc
<pre class="brush: plain;">source ~/.bashrc</pre>
<p>
Now when you run history you should get a output similar to the one below
<pre class="brush: plain;">   502  Aug/12 - 13:48:31 tail -f /home/duffy/log/access.log
  503  Aug/12 - 13:49:01 echo hello
  504  Aug/12 - 13:49:24 more /var/log/syslog</pre>
<p></p>
<h2>Some other bash history tips</h2>
<p></p>
<ol>
<li>
The best way of finding something quickly in your bash history is simply by pressing ctrl+r and then typing out the start of the command it will auto complete it with any matches found in your bash history</li>
<p></p>
<li>If you don't want to save duplicate commands in your bash history simply add export HISTCONTROL=ignoreboth to your .bashrc
<pre class="brush: plain;">echo 'export HISTCONTROL=ignoreboth' &gt;&gt; ~/.bashrc</pre>
</li>
<p></p>
<li>If you want to change the lenght of history add export HISTSIZE=1000 to your .bashrc
<pre class="brush: plain;">echo 'export HISTSIZE=1000' &gt;&gt; ~/.bashrc</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://tuts4tech.net/2009/08/12/howto-add-time-and-date-to-your-bash-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
