Keep a command out of your history

Categories General Info

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

Leave a Reply

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