Ubuntu: history -c doesn't clear
-
Weirdly - even before upgrading to 18.10,
history -c
wasn't clearing the list.Now, even 18.10
history -c
still does not clear the history. -
Chances are you have another terminal open. history -c clears the file out, but any open BASH session will immediately repopulate it with the in memory history cache.
-
@scottalanmiller said in Ubuntu: history -c doesn't clear:
Chances are you have another terminal open. history -c clears the file out, but any open BASH session will immediately repopulate it with the in memory history cache.
I wondered that a few months ago,.. how did the commands in one term list when more than one was open... it joins it.
This is with just one term window is open and even after a reboot.
-
Try this instead...
history -c; history -w
-
you can disable history all together if you want,
https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/
-
@scottalanmiller said in Ubuntu: history -c doesn't clear:
Try this instead...
history -c; history -w
That worked. Thank you.
-
@Emad-R said in Ubuntu: history -c doesn't clear:
you can disable history all together if you want,
https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/
Thank you, I have seen that. But I use history as a track of what I have installed and how I did it. I clear it periodically once I have exported it to a text file.
I do this also to share with my brother - as he's asked me how I've done something a number of times.