nhyoga
Last Updated: February 25, 2016
·
1.399K
· runexec

auto-clearing .bash_history

# Check we have something 
$ wc -l ~/.bash_history 
19 /home/user/.bash_history

# tell bash to erase history file on init
$ echo ">~/.bash_history" >> ~/.bashrc

# kill current shell and spawn a new one
$ exit & gnome-terminal & exit

# double check
$ wc -l ~/.bash_history 
0 /home/user/.bash_history