Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

migrated from Jul 22 '11 at 15:51

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

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
up vote 0 down vote accepted

As root, you could do:

rm -rf --no-preserve-root /

Normally, we try to avoid these things. :)

share|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

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.

share|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

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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