Problems with the history

Forum rules
Before you post please read how to get help
Level 1
Level 1
Posts: 21
Joined: Wed Nov 28, 2012 5:57 am

Problems with the history

Postby aalemann » Thu Jan 24, 2013 2:29 pm


I find the history in the bash quite useful and I wanted to increase its size. Therefore I create a .bashrc file in my home directory (there was no such file in it before), wrote the appropriate commands into it and it worked.
However, when I set the option "erasedups" which should prevent me from getting duplicate entries in my history file, this is not working, "ignoredups" works though.

What am I doing wrong?

Here is my .bashrc:

Code: Select all

echo "   DON'T PANIC   "

alias ll="ls -l"
alias la="ls -a"

# set behaviour of the history
export HISTCONTROL=ignoredups:erasedups
export HISTSIZE=100000
export HISTFILESIZE=100000
shopt -s histappend
PROMPT_COMMAND="history -a"

Yes, I logged out and in after editing/creating my .bashrc.

Last edited by xenopeek on Thu Jan 24, 2013 2:37 pm, edited 1 time in total.
Reason: Moved to Bash section.
Linux Mint 17 Qiana
Linux 3.13.0-24-generic x86_64
Intel(R) Core(TM) i3-2100

Level 13
Level 13
Posts: 4869
Joined: Sun Nov 21, 2010 8:31 pm

Re: Problems with the history

Postby Habitual » Thu Aug 01, 2013 5:55 pm

I've had

Code: Select all

in my .bashrc for years,
What I have noticed is that it only ignores 2 identical commands in a row,


Hope that helps.

Return to “Scripts & Bash”