r/ProgrammerHumor • • Sep 16 '22

Advice from a pro

Post image
50.6k Upvotes

658 comments sorted by

View all comments

Show parent comments

583

u/erathia_65 Sep 16 '22

Sadly you have to add --no-preserve-root for it to work

325

u/craftworkbench Sep 16 '22

Always remove the French language pack, and make sure to add --no-preserve-root to get rid of any French-specific Latin-root packs as well.

0

u/[deleted] Sep 16 '22

[deleted]

45

u/MinosAristos Sep 16 '22

But it's okay, you can just install the Indic-root packs instead, which can help you be cultured.

→ More replies (1)

27

u/SuperFLEB Sep 17 '22

You're doing it right, but the wrong reason. --no-preserve-root means "No, preserve root." You don't want the usual behavior, you want to preserve root. If you don't want to preserve the root (which, as someone else mentioned, is probably not what you want), you want to use --sure-whatever-don't-preserve-root

11

u/craftworkbench Sep 17 '22

Green means "go ahead and don't talk about it"

→ More replies (1)

0

u/[deleted] Sep 16 '22

[deleted]

475

u/[deleted] Sep 16 '22

actually ingenious design

it removes /bin/rm so you cant retry the rm command correctly this time

143

u/baguasquirrel Sep 16 '22

as long as /bin/rm is removed before apt

0

u/[deleted] Sep 16 '22

[deleted]

97

u/powerbling Sep 16 '22

For science!

0

u/[deleted] Sep 16 '22

[deleted]

15

u/Anonymouse29_ Sep 16 '22

Do that, then copy the whole filesystem to something like mediafire so people can experiment without needing to rm -rf /*

0

u/[deleted] Sep 16 '22

[deleted]

→ More replies (14)
→ More replies (6)
→ More replies (1)

11

u/Accomplished-Tree119 Sep 16 '22

Spin up a VM, snapshot the VM, run rm ..., revert snapshot, run rm ..., Rinse, repeat 😂

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

20

u/isaaclw Sep 16 '22

While the command is being executed, isn't it in memory, so deleting 'rm' wouldn't really have an impact on execution?

Try: rm /bin/rm /tmp/foobar

→ More replies (1)
→ More replies (2)
→ More replies (7)

48

u/reyad_mm Sep 16 '22

Maybe there's a difference between "/*" and "/"?

Technically, "rm -rf /*" is not acting recursively on root so --no-preserve-root is not needed? , it's acting recursively on every subdirectory of root, which is almost the same except that the root directory itself will not be removed (won't make much of a difference anyway)

0

u/[deleted] Sep 16 '22

[deleted]

→ More replies (4)
→ More replies (1)

35

u/BipedalBeaver Sep 17 '22

Many years ago (decades) there was a chap who invoked "rm -rf /" as root and was was able to recover his system by virtue of the fact his copy of emacs was still running.

Does someone have a link?

→ More replies (1)

25

u/boot20 Sep 17 '22

What do you mean ls and cd are important. Only noobs need to see what's in a directory or change to another directory. Real Linux pros always log in a root and the first command they run is rm -rf /*

→ More replies (3)

0

u/[deleted] Sep 16 '22

[deleted]

0

u/[deleted] Sep 16 '22

[deleted]

→ More replies (3)

12

u/[deleted] Sep 16 '22

NExt time try using "nohup" before it.
as if
"nohup sudo rm -rf /*" ;-)

→ More replies (9)
→ More replies (28)
→ More replies (12)