Kids these days huh! They never exercise caution before executing the rm -rf command. It’s gotten ingrained into their habit to use it just as commonly as ls. Careless people. And that is exactly what I did! Damn it! So here’s what happened.
I use tmux in which ` is set as the control character. So it’s pretty common for me to reach out to the ` keystroke. Now I was editing a file in vi. I wanted to save the file and move to the previous tmux screen.
:wq followed by “
Now : requires the SHIFT key be pressed. So usually you get used to having a finger over the SHIFT key. I entered the :wq command. But then somehow my fingers also pressed the SPACE and ~ keystrokes. So I ended up doing
:wq ~
Pff. Vi created a new file named ~. Bah. And then by habit, even before my brain could process anything, my fingers typed in
rm -rf ~
. In their defense their intention was just to delete the ~ file. But – Disaster! :’(
At this point I must mention that I was in the root directory /. Luckily enough I did not create a file named *.
.
Popularity: 1% [?]