Clearing history is easy, right? You just run history -c right? Well, sure but then when you log out your history will show you exiting.

When creating virtual machine templates I like to leave the history blank because it's clean and I don't get in the way of anyone or leave accidental secrets in there. Here's a great one-liner to clear the history and log out so you don't leave anything behind;

cat /dev/null > ~/.bash_history && history -c && exit

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>