How can I delete my entire system using terminal? I know that the beginning is rm, but then what?

link|improve this question
I have the root. :) – user91010 Jul 22 '11 at 15:12
Upvoting because it's sheer insanity captured in a 9 word question. :) – Ian C. Jul 22 '11 at 16:05
Upvote for sheer amusement. – surfasb Jul 22 '11 at 21:39
feedback

migrated from stackoverflow.com Jul 22 '11 at 15:51

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 0 down vote accepted

As root, you could do:

rm -rf --no-preserve-root /

Normally, we try to avoid these things. :)

link|improve this answer
Thanks. I am currently doing it on my own computer, I just want to see definitivly how far it will go. – user91010 Jul 22 '11 at 15:12
@Odinulf: All the way. dd if=/dev/zero of=/dev/sda may be easier, though ;) – Piskvor Jul 22 '11 at 15:13
@Odinulf - Indeed, use your power wisely. This will wipe everything... – Jesse Bunch Jul 22 '11 at 15:13
Hmm, I did rm -rf/ and the terminal came out with this: rm: illegal option -- / – user91010 Jul 22 '11 at 15:17
and /dev/sda is not supported. – user91010 Jul 22 '11 at 15:18
show 4 more comments
feedback

Most modern Linux distributions actually disable the ability of removing root by default So to get through this you would use the --no-preserve-rootflag.

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.

link|improve this answer
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. – new123456 Jul 22 '11 at 16:38
feedback

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 ;
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.