9

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

3
  • 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

1

As root, you could do:

rm -rf --no-preserve-root /

Normally, we try to avoid these things. :)

8
  • 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
8

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.

1
  • 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
0

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 ;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .