nhyoga
Last Updated: February 25, 2016
·
1.355K
· runexec
81609937c20aeab3598aea56f1f4f022

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
Say Thanks
Respond
Filed Under