HISTIGNORE
HISTIGNORE is a handy bash option. You can specify certain strings that you want bash to ignore when storing command line history in ~/.bash_history. For those using sudo, you could automatically prevent bash from saving any of your run-as-root commands in your history. Or you can prevent it from storing exit or fg or sundry ls any other such commands that aren't worth remembering.
See also man bash.

1 Comment
Indeed, HISTIGNORE is very cool. If you add "[ \t]*" it will ignore any command that starts with whitespace, so you can choose to record/disregard any command "on the fly" by just prefixing it with a space or not.
I love bash :) (In fact, you'll find some (interesting?) bash tips on my website)
Speak your Mind
Preview