News for hackers. Stuff that matters.
Re:$ sudo rm -rf / === NPM install by throwawaycuriou on Tuesday November 09, 2021 @08:37AM (#29161532)
I believe Apple forked rm to provide protection for this case?

Also, if you're willing to lean into npm a bit, there's tools that give a layer of protection over rm such as https://github.com/sindresorhus/trash-cli

Re:$ sudo rm -rf / === NPM install by wongarsu on Tuesday November 09, 2021 @08:57AM (#29161768)
You might be thinking of the GNU version of rm (the version on any modern linux). There you need `rm -rf --no-preserve-root /` to delete everything, which prevents GP's typo (`rm -rf /*` might still work though).
Re:$ sudo rm -rf / === NPM install by bravetraveler on Tuesday November 09, 2021 @12:27PM (#29164528)
Can confirm /* notation still works. It comes down to how things are interpreted. The shell expands that before rm ever gets argv
Re:$ sudo rm -rf / === NPM install by spicybright on Tuesday November 09, 2021 @08:48AM (#29161645)
Not under Catalina. Don't ask me how I know that.
Re:$ sudo rm -rf / === NPM install by _1 on Tuesday November 09, 2021 @08:53AM (#29161712)
I just tried it in Big Sur and it wouldn't allow it.
Re:$ sudo rm -rf / === NPM install by dima55 on Tuesday November 09, 2021 @01:32PM (#29165463)
Nah, it totally works. Yall should try it.
Re:$ sudo rm -rf / === NPM install by antonvs on Tuesday November 09, 2021 @01:39PM (#29165550)
I just did it and it seems fi
Re:$ sudo rm -rf / === NPM install by kayodelycaon on Tuesday November 09, 2021 @03:11PM (#29166830)
Did it give you the this is dangerous message or a permissions error? If it’s the latter, you probably got stopped by System Integrity Protection.
Re:$ sudo rm -rf / === NPM install by dylan604 on Tuesday November 09, 2021 @01:40PM (#29165556)
You also can't mkdir there either