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
fg or sundry
ls any other such commands that aren't worth remembering.