Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Create a version of rm that detects if you try to delete the root filesystem, deny it, and makes you put a --really-delete-filesystem-root flag to do so.


It does seem like this would be appropriate. All *nix systems share the desire to not accidentally rm -rf /, and it should be easy to check for inside rm.


There's already a flag to preserve /, but that won't help you with /*.


a flag you have to type all the time, or a default that you have to flag out? You can write code to detect /* too.


It might be default in some distros but there is no reason not to put it in an alias. The point is that it's already there and you don't have to modify your rm binary.

And how can you detect /* if the shell expands it?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: