Clearing the history of commands.

In the post "Deleting a command from the history" we saw how to delete command from the history of commands.

But what if we wanted to completely clear the history,i.e. remove all the commands from the history.
This can be done using the option "-c" with the history command.
For e.g. if our history command gives the following output.

Now we can clear it using

If we run the command history again,we will not get any output.

Note: You can not recover the history once it is deleted.

Follow by Email