Clean shell history when logging out

Hello,

There is a simple way of deleting bash's history at the logout. First create a file called .bash_logout in your user home directory and use the clear-command to clear the screen and the history-command to remove the history. Here is how it's done:

open file:
# vim ~/.bash_logout

add this to the file:
rm -f ~/.bash_history
clear
history -c

Save and exit the file. Done 😉

The -c parameter deletes all history. If you want to delete the session hisotry only use -r instead.