How to remove a non-empty directory which is not owned by the user in Linux?
- by Alex B
If a directory "foo" is owned by user A and contains a directory "bar", which is owned by root, user A can simply remove it with rmdir, which is logical, because "foo" is writable by user A.
But if the directory "bar" contains another root-owned file, the directory can't be removed, because files in it must be removed first, so it becomes empty.…