Running “sudo rm -rf /” deletes your Linux or Mac OS X while it is running.
Running “sudo rm -rf /”
You probably wouldn’t want to do that unless you’re really really bored.
Possibly related:
Tags: apple, linux, operating systems, ubuntu
Running “sudo rm -rf /” deletes your Linux or Mac OS X while it is running.
You probably wouldn’t want to do that unless you’re really really bored.
Possibly related:
Tags: apple, linux, operating systems, ubuntu
Comments may be moderated due to spam. No advertisements are allowed in comments.
You'll require some math knowledge to comment, this is done to stop evil bots from spamming my blog.
haha it will be lots of fun to do reinstallation.
by Tianhong (Feb 13, 2008 at 12 AM)Wah… the kitty survived!
by Miccheng (Feb 13, 2008 at 5 AM)hilarious! really a good thing to do, if nothing better to do
by nicole (Feb 13, 2008 at 8 AM)To do that You would have to have root access.FYI Windows root system is the registry.
by onlooker (Feb 13, 2008 at 7 PM)Why does this exist except to screw yourself over?
by Jim (Jul 27, 2009 at 1 PM)This shouldn’t just delete the OS, but everything in root. You literally lose your entire HDD. Although apparently there is a lot even rm -f can’t delete.
The reason it exists, Jim, is because both sudo and rm, with their commands, are essential to running Linux, and this is just one particular application which is incredibly stupid. You might even use “sudo rm -rf” from time to time, but you would only use it on directories you actually want to remove, rather than / (root), which just DELETES FUCKING EVERYTHING. Sudo is a program with many useful applications (it gives you the privelages of root or any other user, provided you have that password), and rm is essential (it removes files and directories). the -r option allows recursively removing files and directories (it will empty a directory, then delete it), which is necessary for deleting non-empty directories. The -f option removes write-protected files, which you can do with root access. Unfortunately, it can’t delete write-protected directories, and apparently some directories are somehow protected even from root. I wonder if a clever application of chmod could fix this.
by Michael (Aug 2, 2009 at 4 PM)Even better,
sudo find / -type f -execdir shred -u -1000 ‘{}’ \;
This finds and shreds (overwrites with meaningless crap) every file in root 1,000 times, then removes it. This guarantees that there is absolutely no way to recover the lost files. Default shredding is just 25 times, so 1,000 might be a bit overkill, but hey, when you are deleting everything, you might as well.
This leaves directories alone, though, so to clean those up, you can execute
sudo rm -rf /
afterwards, if it still works.
by Michael (Aug 2, 2009 at 4 PM)That’s an interesting comment Michael. I haven’t heard of shred. I wanted to shred my files before handing my unstable hard disk over to Seagate as I couldn’t trust they wouldn’t steal my data.
by Mr. Dew (Aug 4, 2009 at 3 AM)I’ve always wanted to see what that what look like, now that you bit the bullet for me, i wont have to. Cheers.
by Das (Oct 27, 2009 at 2 PM)