I use bash and I would like to avoid some commands being kept in the history.
- Is it possible to do that for the next command only?
- Is it possible to do that for the entire session?
bashcommand-line-interfacehistorySecurity
I use bash and I would like to avoid some commands being kept in the history.
Best Answer
and i just remembered another answer, this one is the actual answer to your question.
if you have "ignorespace" in HISTCONTROL, then bash wont remember any line beginning with a space character. it won't appear even in the current shell's history, let alone be saved to $HISTFILE.
e.g. I have export HISTCONTROL='ignoreboth:erasedups' in my ~/.bashrc
here's the details from the bash man page: