bash history

Andy Blanchard zocalo at gmail.com
Sat Apr 28 21:54:02 UTC 2012


On 28 April 2012 22:38, Peter Gueckel <pgueckel at gmail.com> wrote:

> I read about a shell variable called HISTIGNORE that is supposed to
> prevent duplicate
> commands from occurring in .bash_history.
>
> I put the following line into ~/.bash_profile:
>
> export HISTIGNORE="&"
>
> It's not working. I still have duplicate commands galore. Why isn't is
> working?
>

HISTIGNORE only deals with consecutive duplicates, IIRC.

What you want is:

   export HISTCONTROL=erasedups

you might also want to add ":ignorespace" to the end of that.  That will
cause any command prefixed by a space to be ignored as well - very useful
for those long commands that you will only ever run once!

Regards,

-- 
Andy

*The only person to have all his work done by Friday was Robinson Crusoe*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20120428/ce24e93c/attachment.html>


More information about the users mailing list