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.
  1. .bash-history file in user home.
  2. 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,

  1. Open only one terminal for the user whose history you want to remove.
  2. Delete ~/.bash-history file.
  3. run history -c command

Ta da !! I haven't seen the history coming back again ever. Back to my mischievous stuff :)

Comments

Popular posts from this blog

Google Car hits a bus and this time it could be at fault

Finally Renault comes with an AT

Nano converted into a driverless car