When logging out of your bash-shell modern distribution store your 500 last used commands you executed to a file called .bash_history.

Culprit. The complete history file is loaded in memory. There new executed commands are appended and when the shell is properly closed, the buffer is written to disk. The old will be overwritten. So. If you are working in 2 shells at the same time, only 1 session will be saved (ie the last closed).

Savety. Lots has been written about this. Saving your commands can be a severe saveth risk. For example a command like ~>mysql -u knilluz -p mysecretpassword will be stored completely in a worldreadable plain file. Be warned. Turn off historyfunctionality if you are scared by now. He its just ln -s .bash_history /dev/null.

Written by Knilluz on 14 September 2012 at 06:56