Whether it's confidential client data or passwords, there are times when you may not want some commands saved in the history.
To prevent a command from being recorded in the history, you can add a space before the command. For example, if you type a space at the beginning of the command, it will not be saved in the history file.
Remove recent commands from the session history by running the following:
history -c
If you want to turn off the command history temporarily, you can unset the HISTFILE variable using the command:
unset HISTFILE