5 ms·
Prefix the command with a space and bash won't save it in its history.
by veddan 11y ago
Prefix the command with a space and bash won't save it in its history.
- Sophira 11y agoThis doesn't seem to be true in 4.3.42, at least not by default. " echo test" shows up in both the output of the 'history' builtin and in ~/.bash_history. Is it an option that needs to be set?
- reader_1000 11y agoYes, you need to have HISTCONTROL=ignorespace option in your .bashrc
- DyslexicAtheist 11y agogreat thanks didn't know this one. Just checked and there is also # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth