EDIT: not sure why this is being down-voted. It's just an idea, albeit possibly a bad one.
EDIT: not sure why this is being down-voted. It's just an idea, albeit possibly a bad one.
$ rm -rf /
rm: it is dangerous to operate recursively on ‘/’
rm: use --no-preserve-root to override this failsafeIf you add special exceptions for things like "rm -rf /" then you start to wonder, why not add exceptions for other dangerous things, like "find / -delete" and "rm -rf /usr".
In general, most of the basic Unix tools operate off of relatively simple first principles and don't contain exceptions for things like this.
That is, until I installed some version of Red Hat that aliased rm to "rm -i", and extracted a few wrong tar files. Then I understood why the shell is that way, and why everybody just clicks "ok" on Windows dialog boxes without reading the alerts. Funny thing is that I lost some important files because I expected the prompt, but pressed "y" 19 times, instead of 18...
Nowadays I Just do backups.
Case in point, a unix novice coworker of mine came up to me once and said, I think I might have done something wrong. I'm trying to remove an empty directory and it's hanging. Turned out he created a directory in whatever linux workspace gui he was running at the time and accidentally added a space at the end. He didn't notice until he used terminal `ls` to look at it and then noticed it printed like this (with `ls -F`):
somedir /
So he decided to rm it and start over. Can you guess what he typed?