Is there any way to exclude commands like rm -rf, svn revert from being getting stored in bash history? Actually I, by mistake, have issued them a number of times even though I have no intent to do, just because I am doing things quickly and it happened. Hence results in lost of lots of work I have did so far.
Excluding some of the commands from being getting stored in bash history
bash;command history
You might want $HISTIGNORE: A colon-separated list of patterns used to decide which command lines should be saved on the history list. This line in your ~/.bashrc should do the job:HISTIGNORE='rm *:svn revert*'Also, you can add a space at the beginning of a command to exclude it from history. This works as long as $HISTCONTROL contains ignorespace or ignoreboth, which is default on any distro I've used.