Re:$ sudo rm -rf / === NPM install
by josefx on Tuesday November 09, 2021 @09:38AM
(#29162305)
I think on linux it will refuse to run by default an you have to explicitly disable that protection. Of course running rm -rf /opt /* by accident will still delete everything.
[ Parent
| on HN ]
Depends on the distribution I think. The ones I tried here just started deleting things right away: https://bellard.org/jslinux/
Seems to be specific to GNU rm then, the Fedora linux on that page refuses rm -rf / unless you add the --no-preserve-root flag, the other two have a BusyBox based rm.
If you want to run rm -rf I encourage you to run rm -rf >within Gitpod< as many times as you want!
https://archive.md/5lmc9
rm is disallowed to remove . and .. under POSIX, so, for that reason, / needs to be treated specially too.