open de terminal
rm -f ~/.bash_history
history -c
Stop writing to .bash_history for good
Another way to clear history is to delete .bash_history file.
rm -f ~/.bash_history
However, actions on .bash_history will not clear the history of commands
used in the bash session running at that time. That history is stored in
RAM and written to .bash_history when the session ends. The correct way
to clear history is to use 'history -c' because this will clear all
history, including commands used in the session from which the command
'history -c' is given.
If you don’t want to log any history for good, you can do one of two things; turn it off for all users, or turn off logging history for a single user.
Turn off bash history for all users:
Append “unset HISTFILE” to /etc/profile:
# echo "unset HISTFILE" >> /etc/profile
Turn off bash history for a specific user:
Append “unset HISTFILE” to /home/USER/.bash_profile:
# echo "unset HISTFILE" >> /home/USER/.bash_profile