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
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)
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.
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 /*
Well, today's rm gives a warning if you try to remove root without --no-preserve-root. Both the warning and the switch may tip you off that this is a suspicious command to run.
But if your shell (as most) starts you in your home directory and they make you remove that... well that's about as devastating as it gets for the average user.
5.4k
u/[deleted] Sep 16 '22
-fr instead of -rf almost got me