You are not logged in.
Pages: 1
I was trying to clear the bash history list using:
history -c
But it does not work. Actually when I close the terminal and reopen it the history is still there...
Last edited by Milad (2020-05-02 16:45:06)
Offline
Doesn't "history -c" just clear the history saved in RAM (not what's actually saved in ~/.bash_history)? Someone please correct me if I'm wrong here (not 100% sure of this).
Burninate!
Offline
Doesn't "history -c" just clear the history saved in RAM (not what's actually saved in ~/.bash_history)? Someone please correct me if I'm wrong here (not 100% sure of this).
The command will not work from a terminal emulator. You still have bash running when you close the terminal emulator. All you are clearing is that terminal instance's history. To completely clear the history file with the command 'history -c', you need to run it from the login shell.
You could use this to clear the history file:
$ > ~/.bash_history
Offline
Thank you so much. Marked as solved.
Last edited by Milad (2020-05-02 16:45:45)
Offline
Pages: 1