Modern rm by default has the --preserve-root
option enabled, but what exactly does this prevent?
I understand it will prevent rm -r /
(right?)
but does it prevent
cd /
rm *
or
rm /*
for example? The man page and help are not clear, annoying for such an important and dangerous command.
Best Answer
You can try it yourself with
-i
so nothing gets deleted.but
Note that the second would not delete files and directories that match the
/.*
glob.