Jul 9, 2018

How to clear Command line history in Linux

To clear the history, just run any one of the following command after you’re done:

history -c

Or

history -cw

The above commands will clear the recently-executed command in the Terminal. Please remember that you should run ‘history’ command after you executing all commands.