2

I am using cygwin with bash (on Windows 7 pro). I have the following in .bashrc:

# Don't put duplicate lines in the history.
export HISTCONTROL="ignoredups"

and the following in .bash_profile:

# source the system wide bashrc if it exists
if [ -e /etc/bash.bashrc ] ; then
    source /etc/bash.bashrc
fi

# source the users bashrc if it exists
if [ -e "${HOME}/.bashrc" ] ; then
    source "${HOME}/.bashrc"
fi

Yet the command history is littered with duplicates.

2

ignoredups only prevents duplicates matching the preceding line. So, your history shouldn't contain

ls
ls

But it can still contain

ls
cd
ls

man bash says (emphasis mine):

A value of ignoredups causes lines matching the previous history entry to not be saved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.