To clear the history, type the following command:
history -c
Type the following command to remove a certain line (e.g. 890) from the Bash history file :
history -dw 890
-c Clear the history list -d Delete specified line from the history
Don’t save commands in bash history
Unsetting HISTFILE will cause any commands that you have executed in the current shell session not to be written in your bash_history file upon logout :
unset HISTFILE
3 Responses to How to Clear current session history (bash)