I need to clear the terminal cache, I have tried with history -c
but it clears the cache in that terminal session, but if I open another session and type history
it shows all the previous commands.
I need to clear the terminal cache, I have tried with history -c
but it clears the cache in that terminal session, but if I open another session and type history
it shows all the previous commands.
Maybe this happened because you were running it from a terminal emulator, if you want to delete all your history (be wary), you can try to delete directly the file which log it:
See this question, with a few solutions if you are using bash as your shell. There are a few different options, depending on what you are trying to accomplish. There are some ways to clear it now, and ways to clear it on login or logout.
How to clear bash history completely?
Basically speaking,
history -c
clears it but you need to do ahistory -w
to write the empty file to your~/.bash_history
.