DEV Community

Cover image for How to remove or clear the history of all the commands that were executed in the Linux terminal?
MELVIN GEORGE
MELVIN GEORGE

Posted on • Originally published at melvingeorge.me

How to remove or clear the history of all the commands that were executed in the Linux terminal?

Originally posted here!

To remove the history or the traces of all the commands executed, you can use the history command followed by the -c flag (clear contents flag) in the Linux terminal.

# Clear all the traces or the history
# of commands executed
history -c
Enter fullscreen mode Exit fullscreen mode
  • You may have to restart your current terminal session to check if the history has been deleted.

See the execution of the above command live in repl.it.

That's all 😃!

Feel free to share if you found this useful 😃.


Top comments (0)