HISTCONTROL=ignoreboth not working in Debian Lenny

1

1

Can anyone confirm if by setting the following environmental variables under Debian Lenny, it will make previous history entries not be saved? I'm using GNU bash, version 3.2.39(1)-release.

export HISTCONTROL=ignoreboth
export HISTSIZE=500

I have added them to my /etc/bash.bashrc file but I keep getting repeated commands.

Mike

Posted 2010-03-12T16:28:19.637

Reputation:

Answers

2

Use erasedups instead! It work for me!

export HISTCONTROL=erasedups

If you need more options separate them with:

export HISTCONTROL=ignorespace:erasedups

Andrej

Posted 2010-03-12T16:28:19.637

Reputation: 21

0

To uniqely record every new command is tricky. First you need to add to ~/.profile or similar:

HISTCONTROL=erasedups
PROMPT_COMMAND='history -w'

Then you need to add to ~/.bash_logout:

history -a
history -w

Steven Penny

Posted 2010-03-12T16:28:19.637

Reputation: 7 294

Please do not post the same answer to multiple questions. If the same information really answers both questions, then one question (usually the newer one) should be closed as a duplicate of the other. You can indicate this by voting to close it as a duplicate or, if you don't have enough reputation for that, raise a flag to indicate that it's a duplicate. Otherwise tailor your answer to this question and don't just paste the same answer in multiple places.

– DavidPostill – 2018-02-04T20:25:42.593