We all know what the Bash history. Many times we need for some reason (security, paranoia, etc.) that a certain command is NOT saved in the history, that is, and for example, we want all commands to be saved except those related to ssh, in this way if someone manages to access our computer will not be able to know to which computer we do SSH.
To exclude everything related to the command ssh we write the following line in .bashrc :
In this way if for example we do something like:
... will not have been saved in the history 😉
If we want it to exclude everything related to the command ls we write the following:
Remember that the file .bashrc has a period at the beginning of the name, which means that it is a hidden file that is in our home. If you wish, using the echo command you can write directly in .bashrc without having to open it, for example, let's exclude everything related to ssh from the history:
echo "HISTIGNORE='ere*:ssh*'" >> $HOME/.bashrc
Well I think there is nothing more to add.