How can I delete my entire system using terminal? I know that the beginning is rm
, but then what?
-
I have the root. :)– user91010Jul 22, 2011 at 15:12
-
Upvoting because it's sheer insanity captured in a 9 word question. :)– Ian C.Jul 22, 2011 at 16:05
-
Upvote for sheer amusement.– surfasbJul 22, 2011 at 21:39
3 Answers
As root, you could do:
rm -rf --no-preserve-root /
Normally, we try to avoid these things. :)
-
Thanks. I am currently doing it on my own computer, I just want to see definitivly how far it will go. Jul 22, 2011 at 15:12
-
@Odinulf: All the way.
dd if=/dev/zero of=/dev/sda
may be easier, though ;) Jul 22, 2011 at 15:13 -
@Odinulf - Indeed, use your power wisely. This will wipe everything... Jul 22, 2011 at 15:13
-
Hmm, I did
rm -rf/
and the terminal came out with this:rm: illegal option -- /
Jul 22, 2011 at 15:17 -
Most modern Linux distributions actually disable the ability of removing root by default So to get through this you would use the --no-preserve-root
flag.
The complete code to remove the root directory (/) is
rm -rf --no-preserve-root /
you would need to run this as root though.
Another way of doing this is using dd the command for this is
dd if=/dev/zero of=/dev/sd[x]
where [x]
is the drive you want to erase. This rewrites each bit of your drive to 0 which permanently erases everything.
-
Plus, the filesystem errors encountered by using
dd
are quite fun ;) I did the second on my home box, meaning to zero out a flash drive. Jul 22, 2011 at 16:38
Depending on what you mean by deleting, you might get better results by
# for d in /dev/[sh]d? ; do dd if=/dev/zero of=${d} ; done ;