4 ms·
"immutable" top-level folders won't cut it. In order to recursively delete a folder, rm has to delete leaves first. So, you will endup with empty top-level fold
by delamon 1y ago
"immutable" top-level folders won't cut it. In order to recursively delete a folder, rm has to delete leaves first. So, you will endup with empty top-level folders, which is no better.
- charcircuit 1y ago>rm has to delete leaves first There is nothing fundamental with rm for it to work like that.
- lmz 1y agoIt does if you ever want rmdir to succeed.
- ender341341 1y agoI think they mean that rm could check the folder you're trying to delete and see if it has whatever attribute and if so don't delete it's contents. so "rm -rf /" would see that '/' has it and be a no-op, but '~/home/foo' doesn't so it would recurse and start deleting. It could go further do that check for each sub directory recursively, so say '~/home/foo/bar/baz' that 'bar' does have the flag so `rm -rf ~/home/foo/` would delete everything else from the foo folder but leave bar and it's descendants alone.