This is a read-only archive!

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.

July 01, 2007 @ 5:05 AM PDT
Cateogory: Programming

1 Comment

Dieter_be
Quoth Dieter_be on July 01, 2007 @ 7:39 AM PDT

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)