Supposedly, adding export HISTCONTROL=ignoreboth to .bashrc would do the trick, but what I see in practice is there still exists duplicated lines in my .bash_history file.
You can see my .bashrc below.
export HISTFILESIZE=100000
export HISTSIZE=100000
export HISTIGNORE="ls*:rm*:cd*:CD*:ps*:exit*:reset*:clear*:synaptic*:mkdir*:cat*"
export HISTCONTROL=ignoreboth
shopt -s histappend
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
Does anybody know why I'm still getting duplicated lines?
export HISTCONTROL=ignoreboth:erasedups, or you writeexport HISTCONTROL=ignoreboththat's incorrect. – Radu Rădeanu May 15 '13 at 10:26export HISTCONTROL=ignorebothandexport HISTCONTROL=ignoreboth:erasedupsare 2 diff. things – Rinzwind May 15 '13 at 10:26HISTCONTROL=ignorebothignores only duplicate consecutive lines. You'll still get duplicate non-consecutive lines. Is that your problem? – Eric Carvalho May 15 '13 at 10:38man bash: "A value of erasedups causes all previous lines matching the current line to be removed from the history list before that line is saved." Did you test erasedups? – Eric Carvalho May 15 '13 at 11:14