Clean your tracks well
I have been doing lots of mischievous stuff on a Linux machine , and had to be sure that I clean my tracks properly. While playing with bash history every one seems to know that "history -c" command clears the history. But on seldom occasions I could see that my bash history was getting restored magically sans few last commands.
Digging deeper in the man pages, I realized that bash history is stored in not one but two places.
Digging deeper in the man pages, I realized that bash history is stored in not one but two places.
- .bash-history file in user home.
- As an in-memory file.
Now this brings some interesting possibilities as the in-memory file is written back to the .bash-history at times (when a user terminal closes for once). With the new found knowledge I devised a way to wipe out my bash history for sure. You need to take care of three things,
- Open only one terminal for the user whose history you want to remove.
- Delete ~/.bash-history file.
- run history -c command
Ta da !! I haven't seen the history coming back again ever. Back to my mischievous stuff :)
Comments