Keep a command out of your history

Tip: Keep a command out of your history
October 13, 2009, 3:43 pm

If you want an easy way to keep commands out of your ~/.bash_history, do the following:

put this in your .bashrc:

export HISTCONTROL=ignorespace

then in a new bash session when you type in a command, if you put a space before it, it doesn’t appear in your history.

$echo hello #in history

$ echo hello #not in history


I am a g33k, Linux blogger, developer, student and Tech Writer for My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.