Please see in line comments<div><br clear="all">Regards,<br>Vijay Shanker Dubey<br><br>
<br><br><div class="gmail_quote">On Tue, Jan 5, 2010 at 4:26 PM, David Robert Lewis (ethnopunk) <span dir="ltr"><<a href="mailto:ethnopunk@telkomsa.net">ethnopunk@telkomsa.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im"><br>
<br>
<br>
<br>
vijay shanker wrote:<br>
> @ andrew<br>
> Your suggestion does not seems to be working.<br>
> my configuration in ~/.bashrc file<br>
><br>
> # don't put duplicate lines in the history. See bash(1) for more options<br>
> # don't overwrite GNU Midnight Commander's setting of `ignorespace'.<br>
> export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups<br>
> # ... or force ignoredups and ignorespace<br>
> #export HISTCONTROL=ignoreboth<br>
><br>
> @patton<br>
><br>
> Yes; patton this is something I wanted to do. But if my history list<br>
> is clean without any duplicates; i will end my search on this topic.<br>
><br>
> :)<br>
><br>
><br>
> Regards,<br>
> Vijay Shanker Dubey<br>
><br>
><br>
><br>
> On Tue, Jan 5, 2010 at 3:14 PM, Patton Echols <<a href="mailto:p.echols@comcast.net">p.echols@comcast.net</a><br>
</div><div class="im">> <mailto:<a href="mailto:p.echols@comcast.net">p.echols@comcast.net</a>>> wrote:<br>
><br>
>     On 01/05/2010 12:56 AM, vijay shanker wrote:<br>
>     > Hi all,<br>
>     ><br>
>     > I hope many of you must be aware of this.<br>
>     ><br>
>     > When i use a terminal to execute my commands. Some times i need to<br>
>     > execute same command multiple times. So, if i want to choose<br>
>     > a previously executed command, It makes me very tired to choose from<br>
>     > history of command.<br>
><br>
>     Do you mean that you don't want to scroll through the history to<br>
>     get to<br>
>     the command you want?<br>
><br>
>     What I use is [Ctrl]+r  Then start typing the command.  What the shell<br>
>     will do is search back through your commands to the most recent match.<br>
>     Sometimes you need to keep typing a few extra characters to get the<br>
>     right one.<br>
><br>
>     Example:  I routinely ssh to two different computers.  One is the<br>
>     server<br>
>     in my local network and the command is:<br>
</div>>     $ssh <a href="mailto:pecho@192.168.168.5">pecho@192.168.168.5</a> <mailto:<a href="mailto:pecho@192.168.168.5">pecho@192.168.168.5</a>><br>
<div class="im">>     The other is to vpn and remote desktop to my office using this:<br>
>      ssh -C -p 13254 pecho@xxx.xxx.xxx.xxx -L 5901:localhost:5900<br>
><br>
>     if [Ctrl]+R "ssh" gives the first one, then I keep typing until I<br>
>     get to<br>
>     "ssh -" and the shell finds the right one.<br>
><br>
>     Try it!<br>
>     (BTW this is the bash shell which I believe is the standard in Ubuntu)<br>
>     ><br>
>     > So , instead of choosing I prefer to go and write it again. But<br>
>     i was<br>
>     > thinking if there existing any thing that can remove duplicates form<br>
>     > the command history?<br>
><br>
><br>
>     ><br>
>     > Regards,<br>
>     > Vijay Shanker Dubey<br>
>     ><br>
><br>
><br>
<br>
</div>Now that you raise the issue I am keen to try this solution from<br>
<a href="http://blog.macromates.com/2008/working-with-history-in-bash/" target="_blank">http://blog.macromates.com/2008/working-with-history-in-bash/</a>:<br>
<br>
add to bashrc<br>
<br>
export HISTCONTROL=erasedups<br>
export HISTCONTROL=1000<br>
shopt -s histappend<br>
<br></blockquote><div><br></div><div>I have added this in my ~/.bashrc </div><div><br></div><div>But it makes no changes in my bash_history file. not able to describe the situation.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


The first line will remove duplicates<br>
Second line will increase history size<br>
Third line ensures that when you exit a shell the history from that<br>
session is appended<br>
to ~/.bash_history<br>
<br>
Haven't tried it yet, let me know if it works. :)<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="h5">ubuntu-users mailing list<br>
<a href="mailto:ubuntu-users@lists.ubuntu.com">ubuntu-users@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-users</a><br>
</div></div></blockquote></div><br></div>