boltblog

Disable .bash_history logging in bash, Debian

Posted on October 19, 2008

I hate the .bash_history file. It never contains what I want, screws up when using multiple sessions and generally contains junk. I like to disable the .bash_history file, while still keeping the ability to push the "up"-key to scroll through earlier commands in the same session.

The way to do this is to set $HISTFILE to /dev/null. Bash will now log all its history to a nice, black hole.

This can be done at the beginning of ~/.bashrc

...
HISTFILE=/dev/null
...

There. Now I wont forget.

Filed under: Reference Leave a comment
Comments (1) Trackbacks (0)
  1. Thank you – that helped me enabling the .bash_history again – I had a HISTFILE= entry in .bashrc. Appended ~/.bash_history and tada – working again.

    bw, SteveO


Leave a comment

(required)

No trackbacks yet.