| Heh. This is funny timing, as .bash_history made me feel like an idiot just yesterday morning. I was sitting here between queries and I thought 'y'know, all I ever do with history is grep for things. I wonder what else I can do?' When I want to learn about something quick, I usually start with the built-in help; so I did history --help The built-in help for history, unfortunately, is woefully inadequate; this was the output: history: usage: history [-c] [-d offset] [n] or history -awrn [filename] or history -ps arg [arg...] I said to myself: "Hmm. Wonder what those do?" -- and in a moment of bash stupidity, I thought: "well, let's try it!" history -c There's no output from that command, but it didn't take long to figure out what it does. It deletes your entire bash history, clearing the history in RAM and emptying .bash_history. Since I use history all the time, I panicked. Holy crap! What have I done? I spent a few minutes internalizing the obvious lesson that everybody knows - never run commands without knowing them first. Thankfully, though, I had another bash open at the time. And after I'd beaten myself up over it, I thought for a moment, jumped over to the other shell, and did: cd && history | cut -c 8- >> .bash_history ... because (after all) the evil, evil history -c command doesn't kill the history from RAM in other shells. Lucky me. |
*nix hacking ~ heart surgery? Who knew.