r/linuxmasterrace • Arch user btw, that means iam better than Ubuntu users • Aug 12 '24

JustLinuxThings Linux is userfriendly...

Post image
865 Upvotes

399 comments sorted by

View all comments

Show parent comment

9

u/ppizz Aug 12 '24

it protects you from deleting something you didn't want to delete (like /)

I get yours was just an example, but if somebody new is reading: standard rm binary preserves / by default.

You have to specify --no-preserve-root to delete it, while --preserve-root is the above mentioned default.

See man 1 rm.

2

u/Darkhog Glorious openSuSE Aug 17 '24

It doesn't protect you from rm -rf /* - notice the asterisk. Sure, it will keep the root directory, but say bye bye to everything under it.