The Perk of $HOME - .bash_logout
It’s not a well kept secret but I’m still surprised by how many people have
never encountered .bash_logout
. Its purpose is pretty simple,
if you use the BASH shell it’ll be executed when you log out (see, a well
named file!)
So what’s it for? Well, I use mine to invalidate any sudo
sessions I’ve got open (sudo -k
), clear
the
screen -in case it’s a local session - and nuke a history file or two.