Originally, rm would merrily nuke your whole filesystem if you told it to. At some point, someone thought that was a pretty stupid default behaviour, so they added that flag to change the default to not nuke your entire filesystem. However, they made the change backwards compatible in case someone still needed the old behaviour. I can imagine in a container or throwaway environment, it might be vaguely reasonable to expect to be able the blat /.
See also:
Unix gives you just enough rope to hang yourself – and then a couple of more feet, just to be sure.
Not in this case. It’s
*/
here so it expands to directories at current location. I’m sure that’s a typo thoughI’m not brave enough to test it on my distro, so I’ll take your word on that lol
You can do
echo */
andecho /*
to see how they expand. Alsorm -rf /
already is enough without the*
as it already is recursive*
is there to bypass the need for--no-preserve-root
rm -rf /
needs--no-preserve-root
on GNU coreutils, I think.yes
why do they even have that lever
Originally,
rm
would merrily nuke your whole filesystem if you told it to. At some point, someone thought that was a pretty stupid default behaviour, so they added that flag to change the default to not nuke your entire filesystem. However, they made the change backwards compatible in case someone still needed the old behaviour. I can imagine in a container or throwaway environment, it might be vaguely reasonable to expect to be able the blat/
.See also:
Anybody brave enough to tell the MS rep this on patch night??
(You have backups, right?)
I’m aware of how recursive force remove works. I’m just kidding around.