Return “history” command to zero

When we types the history command in terminal, we get the result which is the previous commands we entered, how to delete these commands and begin from scratch?

To do this you only need to put this command in your terminal:

cat /dev/null > ~/.bash_history && history -c && exit

The command cat /dev/null > ~/.bash_history clears the contain of ~/.bash_history file. And history -c deletes the current terminal history.

The References:

Advertisements