Linux : How To Delete Bash History

Friday, September 30, 2011 10:08 AM 0 Comments , , ,


Delete bash history

To delete the bash history for your current session as well as old sessions, you should do two things:

Delete the .bash_history file:

rm -rf ~/.bash_history

Clear the current history stored in RAM:

history -c




Turn off bash history for all users:

Append “unset HISTFILE” to /etc/profile:

echo "unset HISTFILE" >> /etc/profile

Turn off bash history for a specific user:

Append “unset HISTFILE” to /home/USER/.bash_profile:

echo "unset HISTFILE" >> /home/USER/.bash_profile
Good Luck ~

0 comments: