Does the "execute" bit a开发者_如何学JAVAlso mean "deletion" permissions, or do I need "write" permissions for that?
To remove a directory, the parent of that directory must be writable by the effective user. The write
and execute
flags of the directory being removed do not matter.
Additionally, one cannot remove a directory if it is not empty. Often a user will use the rm -r
command to remove a non-empty directory tree recursively by first removing all its contents. If the user does not have write permission to the subdirectories, he/she cannot empty their contents first.
No, the 'execute' bit is used by directories to determine whether a 'user' can view the files listed in the directory. In regards to deletion the relevant bit is the 'write' permission bit of the parent directory.
精彩评论