<?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>Linux 101 Hacks &#187; 08. Command Line History</title>
	<atom:link href="http://linux.101hacks.com/category/command-line-history/feed/" rel="self" type="application/rss+xml" />
	<link>http://linux.101hacks.com</link>
	<description>Free eBook to Build a Strong Foundation in UNIX / Linux</description>
	<lastBuildDate>Fri, 09 Dec 2011 06:07:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Hack 64. Ignore specific commands from the history using HISTIGNORE</title>
		<link>http://linux.101hacks.com/command-line-history/histignore/</link>
		<comments>http://linux.101hacks.com/command-line-history/histignore/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 23:07:17 +0000</pubDate>
		<dc:creator>Ramesh</dc:creator>
				<category><![CDATA[08. Command Line History]]></category>

		<guid isPermaLink="false">http://linux.101hacks.com/?p=218</guid>
		<description><![CDATA[Sometimes you may not want to clutter your history with basic commands such as pwd and ls. Use HISTIGNORE to specify all the commands that you want to ignore from the history. Please note that adding ls to the HISTIGNORE ignores only ls and not ls -l. So, you have to provide the exact command [...]]]></description>
		<wfw:commentRss>http://linux.101hacks.com/command-line-history/histignore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hack 63. Disable the usage of history using HISTSIZE</title>
		<link>http://linux.101hacks.com/command-line-history/disable-history-using-histsize/</link>
		<comments>http://linux.101hacks.com/command-line-history/disable-history-using-histsize/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 23:05:57 +0000</pubDate>
		<dc:creator>Ramesh</dc:creator>
				<category><![CDATA[08. Command Line History]]></category>

		<guid isPermaLink="false">http://linux.101hacks.com/?p=216</guid>
		<description><![CDATA[If you want to disable history all together and don’t want bash shell to remember the commands you’ve typed, set the HISTSIZE to 0 as shown below. # export HISTSIZE=0 # history # [Note: History did not display anything]]]></description>
		<wfw:commentRss>http://linux.101hacks.com/command-line-history/disable-history-using-histsize/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hack 62. Substitute a specific argument for a specific command</title>
		<link>http://linux.101hacks.com/command-line-history/get-argument-from-a-specific-command/</link>
		<comments>http://linux.101hacks.com/command-line-history/get-argument-from-a-specific-command/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:58:41 +0000</pubDate>
		<dc:creator>Ramesh</dc:creator>
				<category><![CDATA[08. Command Line History]]></category>

		<guid isPermaLink="false">http://linux.101hacks.com/?p=214</guid>
		<description><![CDATA[In the example below, !cp:2 searches for the previous command in history that starts with cp and takes the second argument of cp and substitutes it for the ls -l command as shown below. # cp ~/longname.txt /really/a/very/long/path/long-filename.txt # ls -l !cp:2 ls -l /really/a/very/long/path/long-filename.txt In the example below, !cp:$ searches for the previous command [...]]]></description>
		<wfw:commentRss>http://linux.101hacks.com/command-line-history/get-argument-from-a-specific-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hack 61. Substitute words from history commands</title>
		<link>http://linux.101hacks.com/command-line-history/get-arguments-from-previous-command/</link>
		<comments>http://linux.101hacks.com/command-line-history/get-arguments-from-previous-command/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:56:58 +0000</pubDate>
		<dc:creator>Ramesh</dc:creator>
				<category><![CDATA[08. Command Line History]]></category>

		<guid isPermaLink="false">http://linux.101hacks.com/?p=212</guid>
		<description><![CDATA[When you are searching through history, you may want to execute a different command but use the same parameter from the command that you’ve just searched. In the example below, the !!:$ next to the vi command gets the argument from the previous command to the current command. # ls anaconda-ks.cfg anaconda-ks.cfg # vi !!:$ [...]]]></description>
		<wfw:commentRss>http://linux.101hacks.com/command-line-history/get-arguments-from-previous-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hack 60. Clear all the previous history using option -c</title>
		<link>http://linux.101hacks.com/command-line-history/delete-history/</link>
		<comments>http://linux.101hacks.com/command-line-history/delete-history/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:55:01 +0000</pubDate>
		<dc:creator>Ramesh</dc:creator>
				<category><![CDATA[08. Command Line History]]></category>

		<guid isPermaLink="false">http://linux.101hacks.com/?p=210</guid>
		<description><![CDATA[Sometime you may want to clear all the previous history. However you may still want to keep the history moving forward. # history -c]]></description>
		<wfw:commentRss>http://linux.101hacks.com/command-line-history/delete-history/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hack 59. Force history not to remember a particular command using HISTCONTROL</title>
		<link>http://linux.101hacks.com/command-line-history/histcontrol-ignorespace/</link>
		<comments>http://linux.101hacks.com/command-line-history/histcontrol-ignorespace/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:53:45 +0000</pubDate>
		<dc:creator>Ramesh</dc:creator>
				<category><![CDATA[08. Command Line History]]></category>

		<guid isPermaLink="false">http://linux.101hacks.com/?p=208</guid>
		<description><![CDATA[When you execute a command, you can instruct history to ignore the command by setting HISTCONTROL to ignorespace AND typing a space in front of the command as shown below. I can see lot of junior sysadmins getting excited about this, as they can hide a command from the history. It is good to understand [...]]]></description>
		<wfw:commentRss>http://linux.101hacks.com/command-line-history/histcontrol-ignorespace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hack 58. Erase duplicates across the whole history using HISTCONTROL</title>
		<link>http://linux.101hacks.com/command-line-history/histcontrol-erasedups/</link>
		<comments>http://linux.101hacks.com/command-line-history/histcontrol-erasedups/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:51:30 +0000</pubDate>
		<dc:creator>Ramesh</dc:creator>
				<category><![CDATA[08. Command Line History]]></category>

		<guid isPermaLink="false">http://linux.101hacks.com/?p=205</guid>
		<description><![CDATA[The ignoredups shown above removes duplicates only if they are consecutive commands. To eliminate duplicates across the whole history, set the HISTCONTROL to erasedups as shown below. # export HISTCONTROL=erasedups # pwd # service httpd stop # history &#124; tail -3 38 pwd 39 service httpd stop 40 history &#124; tail -3 # ls -ltr [...]]]></description>
		<wfw:commentRss>http://linux.101hacks.com/command-line-history/histcontrol-erasedups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hack 57. Eliminate the continuous repeated entry from history using HISTCONTROL</title>
		<link>http://linux.101hacks.com/command-line-history/histcontrol-ignoredups/</link>
		<comments>http://linux.101hacks.com/command-line-history/histcontrol-ignoredups/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:49:30 +0000</pubDate>
		<dc:creator>Ramesh</dc:creator>
				<category><![CDATA[08. Command Line History]]></category>

		<guid isPermaLink="false">http://linux.101hacks.com/?p=202</guid>
		<description><![CDATA[In the following example pwd was typed three times, when you do history, you can see all the 3 continuous occurrences of it. To eliminate duplicates, set HISTCONTROL to ignoredups as shown below. # pwd # pwd # pwd # history &#124; tail -4 44 pwd 45 pwd 46 pwd 47 history &#124; tail -4 [...]]]></description>
		<wfw:commentRss>http://linux.101hacks.com/command-line-history/histcontrol-ignoredups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hack 56. Change the history file name using HISTFILE</title>
		<link>http://linux.101hacks.com/command-line-history/histfile/</link>
		<comments>http://linux.101hacks.com/command-line-history/histfile/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:48:09 +0000</pubDate>
		<dc:creator>Ramesh</dc:creator>
				<category><![CDATA[08. Command Line History]]></category>

		<guid isPermaLink="false">http://linux.101hacks.com/?p=200</guid>
		<description><![CDATA[By default, history is stored in ~/.bash_history file. Add the following line to the .bash_profile and relogin to the bash shell, to store the history command in .commandline_warrior file instead of .bash_history file. I’m yet to figure out a practical use for this. I can see this getting used when you want to track commands [...]]]></description>
		<wfw:commentRss>http://linux.101hacks.com/command-line-history/histfile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hack 55. Control the total number of lines in the history using HISTSIZE</title>
		<link>http://linux.101hacks.com/command-line-history/histsize-histfilesize/</link>
		<comments>http://linux.101hacks.com/command-line-history/histsize-histfilesize/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:46:59 +0000</pubDate>
		<dc:creator>Ramesh</dc:creator>
				<category><![CDATA[08. Command Line History]]></category>

		<guid isPermaLink="false">http://linux.101hacks.com/?p=198</guid>
		<description><![CDATA[Append the following two lines to the .bash_profile and relogin to the bash shell again to see the change. In this example, only 450 command will be stored in the bash history. # vi ~/.bash_profile HISTSIZE=450 HISTFILESIZE=450]]></description>
		<wfw:commentRss>http://linux.101hacks.com/command-line-history/histsize-histfilesize/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Content Delivery Network via Amazon Web Services: CloudFront: static.101hacks.com

Served from: linux.101hacks.com @ 2012-02-04 04:15:21 -->
