It's a nice addition for certain use cases, however in the case of running "rm -rf ...", it has no effect because of the "-f / --force" flag set afterwards.
"rm -if" never prompts, "rm -fi" prompts. --preserve-root is an entirely different thing which will stop the command from deleting files even if you told it to.
$ sudo rm -ri /
rm: it is dangerous to operate recursively on '/'
rm: use --no-preserve-root to override this failsafe
When in doubt, you might want to activate xtrace with "set -x", run the command and see what it expanded to. then "set +x" to disable.
rpigab|1 month ago
"rm -if" never prompts, "rm -fi" prompts. --preserve-root is an entirely different thing which will stop the command from deleting files even if you told it to.
When in doubt, you might want to activate xtrace with "set -x", run the command and see what it expanded to. then "set +x" to disable.zahlman|1 month ago
(I would write something like "Refusing to delete the entire filesystem (did a shell variable expansion go wrong?)".)