1546
you are viewing a single comment's thread
view the rest of the comments
[-] nefarious@kbin.social 100 points 1 year ago* (last edited 1 year ago)

Careful, you have to also add --no-preserve-root to make sure you get all of it out. If you leave the roots, it'll just grow back later!

(But seriously, don't actually do this unless you're prepared to lose data and potentially even brick your computer. Don't even try it on a VM or a computer you're planning to wipe anyway, because if something is mounted that you don't expect, you'll wipe that too. On older Linux kernels, EFI variables were mounted as writable, so running rm -rf / could actually brick your computer. This shouldn't still be the case, but I wouldn't test it, myself.)

[-] Barbarian@sh.itjust.works 45 points 1 year ago* (last edited 1 year ago)

Fun fact, rm -rf /* does not need --no-preserve-root. It will happily start as technically, according to the preserve root check, /* is not root as the target is not /

[-] koper@feddit.nl 15 points 1 year ago* (last edited 1 year ago)

It's slightly different. Your shell will see the /* and replace it with all the directories under /, e.g. /bin /dev /etc /home etc. So the actual command that runs is rm -rf /bin /dev /etc /home etc.

Careful, you have to also add --no-preserve-root to make sure you get all of it out. If you leave the roots, it’ll just grow back later!

Oh my god I effin guffawed, thanks for that

[-] Infernal_pizza@lemmy.world 3 points 1 year ago

I ran it in Hyper-V once to see what happens and it deletes all the boot entries from the VM firmware (including pxe boot and the dvd drive)

this post was submitted on 10 Aug 2023
1546 points (94.3% liked)

Programmer Humor

18872 readers
861 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS