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

  • I have the root. :)
    – user91010
    Jul 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.
    – surfasb
    Jul 22, 2011 at 21:39

3 Answers 3


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.
    – user91010
    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 -- /
    – user91010
    Jul 22, 2011 at 15:17
  • and /dev/sda is not supported.
    – user91010
    Jul 22, 2011 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.

  • 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, 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 ;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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