Clearing Command Line History
Oh dear, you've made a mistake on a clients server and want to hide the evidence...
There's a few options here:here, also see the history man page for more info.
1. Remove the command from bash history using the history -d command:
history -d LINE-NUMBER
The downside of this, is that the command run to delete the history will be included in the bash history, this brings us on to the sneakier method.
2.
history -d LINE-NUMBER && history -w
3. Finally, there's another option we use to clear the entire bash history:
history -c