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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s