How to stop Bash appending history
Posted
by
Craig
on Super User
See other posts from Super User
or by Craig
Published on 2011-09-15T03:29:49Z
Indexed on
2012/06/10
10:42 UTC
Read the original article
Hit count: 378
I am having a lot of trouble setting up the terminal history of Bash the way I want.
I would like to have no duplicate entries and if I enter a command I want it saved and the duplicates above removed.
The problem is the history command shows me it is functioning the way I want however once I log out the duplicates come back again. I believe it is just appending the history to the existing one.
I have these lines in my .bashrc file (~/.bashrc)
HISTCONTROL=ignoreboth:erasedups
shopt -u histappend
I have even tried uncommenting shopt but it still appends the history on logout.
How can I have the history be exactly how it is before I logout?
© Super User or respective owner