Just curious, what happens in OS X Maverick if someone issues
sudo rm -rf /?
I heard most modern *nix systems are protected from this epic fail.
In the interest of science, a VM died to answer this question:
testrm:~ admin$ sudo rm -rf / WARNING: Improper use of the sudo command could lead to data loss or the deletion of important system files. Please double-check your typing when using sudo. Type "man sudo" for more information. To proceed, enter your password, or type Ctrl-C to abort. Password: rm: /dev/fd/0: Operation not supported rm: /dev/fd/1: Operation not supported rm: /dev/fd/2: Operation not supported rm: /dev/fd/3: Not a directory rm: /dev/fd/4: Bad file descriptor rm: /dev/fd: Operation not supported rm: /dev: Resource busy rm: /home: Resource busy rm: /net: Resource busy rm: /private/var/log: Directory not empty rm: /private/var/run: Directory not empty rm: /private/var: Directory not empty rm: /private: Directory not empty rm: /System/Library: Directory not empty rm: /System: Directory not empty rm: /: Is a directory testrm:~ admin$
Interestingly, it succeeded. Back in the Slackware 2 days, I tried this on Linux and after it deleted the dynamically linked libraries rm was using, it failed.
Curiosity killed the cat. Do not, under any circumstances, try this at home.
There are no protections. The
--root-protect option was introduced in GNU
rm (on by default).
The rm man page for 10.9 does not mention anything like this. Once you've entered your password, it's all gone. Hope you remembered today is International Backup Day (It's always International Backup Day).