On more than one occasion we have wanted to delete the history of commands that we have executed on our computer in linux. Delete the .bash_history file located in our home is an option, but it is always better to use the tools or options that the system itself offers . Let's see how to clear linux bash history.
We will learn two ways to do it:
History -c: So simple! A simple parameter (-c) tells the system to delete the command history.
- Another method that should work is also:
Echo ""> ~ / .bash_history
This should put a blank line in our history deleting everything else
Easy and quick. Hope it helps!