Last Updated on July 1, 2015 by admin
The Bash hisrory on a linux system is stored in the file .bash_history of the home directory of the user. To clear the history for the currently logged in user, run these commands:
cat /dev/null > ~/.bash_history
If you like to clear the history of a different user, use these commands. In the example I will cler the history for a user named tom:
cat /dev/null > /home/tom/.bash_history
Please note that you have to be logged in as root user to cler the Bash history of another user or use sudo to execute the command.
sudo cat /dev/null > /home/tom/.bash_history