<?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>Lindesk &#187; setting</title>
	<atom:link href="http://lindesk.com/tag/setting/feed/" rel="self" type="application/rss+xml" />
	<link>http://lindesk.com</link>
	<description>Linux - on the Desktop</description>
	<lastBuildDate>Tue, 23 Jun 2009 14:03:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Customizing the Terminal: 5 Configuration Settings in Bash that makes you a CLI Power User</title>
		<link>http://lindesk.com/2009/04/customize-terminal-configuration-setting-bash-cli-power-user/</link>
		<comments>http://lindesk.com/2009/04/customize-terminal-configuration-setting-bash-cli-power-user/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 19:40:09 +0000</pubDate>
		<dc:creator>BinnyVA</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[setting]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://lindesk.com/?p=185</guid>
		<description><![CDATA[There are some settings that are very useful if you work on the terminal a lot. Many of the cool ones are not enabled by default - this is a small list of the configuration settings that I use to make my terminal usage more productive.]]></description>
			<content:encoded><![CDATA[<p><img src="http://lindesk.com/wp-content/uploads/2008/02/terminal.png" alt="Terminal" title="Terminal" width="128" height="128" class="alignnone size-full wp-image-96 intro" align="right" /></p>
<p class="intro">There are some settings that are very useful if you work on the terminal a lot. Many of the cool ones are not enabled by default &#8211; this is a small list of the configuration settings that I use to make my terminal usage more productive.</p>
<p>This is part 3 of the Customizing the Terminal series. Already published posts in this series are&#8230;</p>
<ul>
<li><a href="http://lindesk.com/2009/03/customizing-the-terminal-the-prompt/">Customizing the Terminal: The Prompt</a></li>
<li><a href="http://lindesk.com/2009/03/customizing-the-terminal-create-useful-aliases/">Customizing the Terminal: Create Useful Aliases</a></li>
</ul>
<h2>1. Case Correction</h2>
<p>I like to title case my folders and files&#8217; names. The folders in my home are &#8216;Scripts&#8217;, &#8216;Documents&#8217;, &#8216;Temp&#8217; etc. The first character is in upper case. But when I work on the command line, I don&#8217;t always remember to uppercase the first character when trying to cd into a folder. Consequently, the tabbing will not work. Fortunately, there is an option that <strong class="highlight">auto corrects the case</strong> for you. Just open a terminal and type in this command&#8230;</p>
<pre><code class="bash">shopt -s nocaseglob</code></pre>
<p>Other useful shopt option are&#8230;</p>
<dl>
<dt>cdspell</dt>
<dd>Corrects typos in your file/directory name.</dd>
<dt>histappend</dt>
<dd>Makes sure that histories in multiple simultaneous shells don&#8217;t overwrite each other.</dd>
</dl>
<h2>2. Select Which Commands to Store in History</h2>
<p>By default, all commands you type in are stored in the history. You can pick and chose the commands you want to store by putting the option&#8230;</p>
<pre><code class="bash">export HISTCONTROL=ignorespace</code></pre>
<p>in your <code>~/.bash_profile</code> file. This will <strong class="highlight">make sure that bash don&#8217;t store any command beginning with the space character</strong>. So if you want bash to forget that you typed in &#8216;ls&#8217;, just type in &#8216; ls&#8217;(&lt;space&gt;ls).</p>
<h2>3. Don&#8217;t Store Duplicate Commands in your History</h2>
<p>As I said earlier, all commands you type are stored &#8211; even the duplicate ones. You can prevent this by putting this text in your <code>.bash_profile</code> file&#8230;</p>
<pre><code class="bash">export HISTCONTROL=ignoredups</code></pre>
<p>If you want to ignore spaced commands <em>and</em> want to prevent storing of duplicate commands, use the option&#8230;</p>
<pre><code class="bash">export HISTCONTROL=ignoreboth</code></pre>
<h2>4. Auto-complete Command from History</h2>
<p>Picture this &#8211; you type in &#8217;ssh&#8217; and press the &#8216;Page Up&#8217; key &#8211; and <strong class="highlight">bash automatically fetches the last command that starts with ssh</strong> &#8211; and completes the command for you. Well, its possible &#8211; add the following line in your &#8216;.bash_profile&#8217; file&#8230;</p>
<pre><code class="bash">export INPUTRC=$HOME/.inputrc</code></pre>
<p>Now, <strong class="highlight">create a file called <code>.inputrc</code></strong> in your home and enter this into it&#8230;</p>
<pre><code class="bash">#Page up/page down
"\e[5~": history-search-backward
"\e[6~": history-search-forward</code></pre>
<p>Yes, I am aware of the up Ctrl+R trick &#8211; that comes in the next post.</p>
<h2>5. Infinite History</h2>
<p>You can increase or decrease the size of the history by adding this line in the <code>.bash_profile</code> file&#8230;</p>
<pre><code class="bash">export HISTSIZE=500
export HISTFILESIZE=500</code></pre>
<p>This will limit the commands to be stored in the history to 500. If you want to <strong class="highlight">remove the limit use these</strong> lines&#8230;</p>
<pre><code class="bash">unset HISTSIZE
unset HISTFILESIZE</code></pre>
<p>There is a good chance that this will make your history file quite huge &#8211; <strong class="highlight">use with care</strong>.</p>
<p>Please share your configuration settings for bash in the comments.</p>
<h3>Related Links</h3>
<ul>
<li><a href="http://linux.about.com/library/cmd/blcmdl1_shopt.htm">shopt &#8211; Linux Command</a></li>
<li><a href="http://snipplr.com/view/5393/shopt-shell-options/">shopt (shell options) &#8211; Bash</a></li>
<li><a href="http://www.ducea.com/2006/05/15/linux-tips-take-control-of-your-bash_history/">Linux Tips: take control of your bash_history</a></li>
<li><a href="http://www.thegeekstuff.com/2008/08/15-examples-to-master-linux-command-line-history/">15 Examples To Master Linux Command Line History</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lindesk.com/2009/04/customize-terminal-configuration-setting-bash-cli-power-user/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
