Since I keep my bash history under source control, I've noticed that sometimes sizable segments of the history end up repeated, sometimes hours or days after their original execution. I use Debian 7.7 and have the following config:
shopt -s histappend
export HISTCONTROL=ignoreboth:erasedups
export HISTSIZE=1000000
export HISTFILESIZE=1000000
I suspect there is some interaction between multiple terminals, histappend
, and erasedups
. I'm answering this question myself but if someone disagrees or has more detail I would like other answers!
Edit: I believe this is not a duplicate -- there are many questions asking how to ignore duplicate entries; I'm asking about getting rid of a buggy behavior around mistakenly duplicated history segments. (Whole chunks repeated that I had actually executed only once.)