-r means delete recursively. rm will by default only remove files, but with this flag, it’ll also delete all the folders, subfolders, and the files in those.
--no-preserve-root disables a security check. A few years ago, this flag didn’t exist. If you ran rm -r /, everything on your system would be deleted, provided the user had permissions. Now, / is treated specially and rm will refuse to perform a recursive delete on it without the --no-preserve-root flag.
-f means force and disables any prompts.
rm -rf --no-preserve-root / would delete every file on your system.
-r
means delete recursively.rm
will by default only remove files, but with this flag, it’ll also delete all the folders, subfolders, and the files in those.--no-preserve-root
disables a security check. A few years ago, this flag didn’t exist. If you ranrm -r /
, everything on your system would be deleted, provided the user had permissions. Now,/
is treated specially andrm
will refuse to perform a recursive delete on it without the--no-preserve-root
flag.-f
means force and disables any prompts.rm -rf --no-preserve-root /
would delete every file on your system.Thank you! That’s funny and horrifying, as a complete newbie.
I installed Ubuntu on a spare computer a few weeks ago just to rm -rf / it. It was quite fun seeing the os slowly killing itself :)
You should try dd if=/dev/random of=/dev/sda some time :P
Should I ask what it does before or after I use it? :)
Fills the hard drive with randomly-generated garbage.
Specifically, most likely the OS hard drive, since that’s usually sda