Disable .bash_history logging in bash, Debian

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.

1 Comment

  • SteveO says:

    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 Reply to SteveO Cancel reply

Your email address will not be published. Required fields are marked *