Linux:Clear All Shell History

This post will guide you how to clear bash shell history completely in CentOS/RHEL/Ubuntu Linux. How do I clear the terminal history in Linux. How to delete all command line history under Linux operating system.

Clear All Shell History


If you want to clear all bash shell history in your current Linux system, you just need to type the following command:

#history –c

This command will clear bash shell history completely.

Or you can also try to delete history file to clear all history of bash shell, type the following command:

#rm ~/.bash_history

Or

#echo ”” > ~/.bash_history

If you want to get more information about history command, just run any of the following commands:

#help history

#man history

See Also:

You might also like:

Sidebar



back to top