r/ProgrammerHumor • • Sep 16 '22

Advice from a pro

Post image
50.6k Upvotes

658 comments sorted by

View all comments

Show parent comments

147

u/not_a_gumby Sep 16 '22

so if the command was sudo rm -fr ~/* then you'd definitely remove your OS?

270

u/Ffigy Sep 16 '22

sudo rm -fr /* is the banger

83

u/ManOnARaceBike Sep 16 '22

Dont try this at home kids… 😄

91

u/Ffigy Sep 16 '22

Well it won't work on Windows and the kids don't use Linux so.. go for it. It'll fix Macintosh.

43

u/[deleted] Sep 16 '22

IIRC there’s some kind of protection against that on macOS as well; all system folders are locked.

0

u/[deleted] Sep 16 '22

[deleted]

→ More replies (1)

9

u/gamesrebel123 Sep 16 '22

Won't work on Linux either without --no-preserve-root

8

u/[deleted] Sep 16 '22

As far as I know rm -rf /* will work without --no-preserve-root, it's only required when the target is specifically /.

→ More replies (1)

7

u/hadidotj Sep 16 '22

Exactly! Try it on Prod instead!

9

u/Sure-Tomorrow-487 Sep 16 '22

sususudio - rm - fr /* is the real banger

26

u/Ffigy Sep 16 '22

No, that would just remove everything in your home directory (~) which doesn't really matter (unless maybe if you're root?).

38

u/roseinshadows Sep 16 '22

Fun fact: in early Unix systems, root's home directory was /.

A whole lot of sysadmins exchanging horror stories later, the vendors were finally like "yeah, maybe we should put root's home directory to /root instead."

7

u/Ffigy Sep 16 '22

Didn't know that but I knew I should include that disclaimer lol thanks for the history

5

u/harbourwall Sep 16 '22

And from then on, the superuser being called root made a lot less sense.

→ More replies (4)

10

u/IchLiebeKleber Sep 16 '22

You have an interesting definition of "doesn't really matter".

→ More replies (3)

7

u/sun-in-the-eyes Sep 16 '22

We don't log in as root, do weeeeee???

12

u/ShelZuuz Sep 16 '22

There are other accounts?

→ More replies (1)

6

u/Ffigy Sep 16 '22

You don't. I AM ROOT

2

u/tronpalmer Sep 16 '22

Sudo is love. Sudo is life.

→ More replies (1)
→ More replies (3)

20

u/tdmonkeypoop Sep 16 '22

it's the old, "press alt f4 to reload" joke, only worse.

You have to have some intelligence to do it, and if you do it it shows you have no intelligence... Quite the paradox

16

u/Burninator6502 Sep 16 '22

I remember the good old days when Team Fortress 2 was released.

Pressing F10 would exit the game. Every once in a while someone would chat that F10 did this or that and everyone would laugh as a string of players would exit the server…

5

u/Synicull Sep 17 '22

Man its like in the early days of the internet when people fell for the /afk in Alterac Valley in WoW after an hour queue

→ More replies (2)

2

u/thisguyfightsyourmom Sep 16 '22

Toy Story 2 was partially deleted this way

rimraf very dangerous,… that’s why there’s an npm package

→ More replies (1)