I am dumb (fortunately)

ethan on 2003-07-23T09:36:09

I was routinely dealing with a bugreport from someone which involved saving a couple of files (that he sent as attachment) into my home-dir and creating some directories.

After that I wanted to delete them and did a rm -r thismail*. Haha, I thought I did it, but instead I did a rm -r thismail *.

Whoooooo! I just deleted my home-directory including all my emails and all the source-code I have produced over the last three years!!! I was shocked as you may gather.

Hastily I looked at the ext2-undeletion-how-to, tried a couple of things...and amongst all I was surprised that when looking at the deleted inodes with debugfs, there were hardly any that I deleted recently (there should have been thousands of them). But I carried on getting more and more into real panic.

But then something dawned on me! My emails and my source-code directory were just soft-links to a directory on another partition. So only the soft-link was deleted and of course, I still have all my data. Pheeew. Naturally, all the regular files in my home-dir (excluding dot-files and directories) were scratched, but that's not so serious. They needed a clean-up anyways. All important files (data, config-files) are still there. It took me two hours to find that out. Now this days is going to be good! :-)


oops

jdavidboyd on 2003-07-23T13:01:55

I think that is why everyone I know aliases 'rm' to be 'rm -i'.

Re:oops

jmm on 2003-07-23T14:50:22

Nah, some of us just check rm commands very carefully. (I did my 'rm -rf / work*' back in 1986 and I haven't forgotten it. Nor has Mietek, who is still extremely careful about making and testing backups to this day.)

Aliasing 'rm' to 'rm -i' is a dangerous crutch to depend upon - you will surely someday run on a system that doesn't have the alias set up or manage to bypass the alias in some other way.

Re:oops

koschei on 2003-07-23T23:31:49

Whereas I use zsh and ensure zsh is my shell everywhere. Less irritating than confirming every delete, only the potentially big ones.

That said, I haven't misspaced since using zsh anyway =)