Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I just did that last weekend!

After an allnighter, which isn't easy for me anymore, I typed:

``rm -rf. /*``

with the dot and the space reversed.

When the shell threw an error in my face, I thought, "oh, an extra dot." so I deleted the dot and re-run the command.

And there goes my configs and most of the dotfiles in my home dir. Luckily, I have backup for some of those, so it wasn't a complete disaster.

I don't trust myself doing ``rm`` in commandline anymore.



This has nothing to do with the OP, but I always rehearse my deletions with "ls -d", and after seeing the output hit the up arrow in my command history and replace it with the rm command I wanted to attempt. I also never use -r without intention - a lot of people use it habitually even when not deleting a directory. Lastly, I never -f, I just chmod first.


I tend to use the command line utility tras-cli instead for these reasons. So easy to screw up with a wild card.


It doesn't hurt to do some variation of pointing and calling when doing destructive commands like rm https://en.wikipedia.org/wiki/Pointing_and_calling


This is why I never use rm when I'm tired or working on important system anymore. I'll just mv the files somewhere for review later. Worst case is I just moved a wrong file and can simply restore it back.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: