Keep a command out of your history

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

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

g33kadmin

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. 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.