chmod 755 用于目录 - 这是否允许每个人删除该文件夹?
“执行”位是否也意味着“删除”权限,或者我是否需要“写入”权限?
Does the "execute" bit also mean "deletion" permissions, or do I need "write" permissions for that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要删除目录,该目录的父目录必须可由有效用户写入。被删除目录的
write
和execute
标志并不重要。此外,如果目录不为空,则无法删除该目录。通常,用户会使用 rm -r 命令通过首先删除其所有内容来递归删除非空目录树。如果用户没有子目录的写权限,他/她不能先清空子目录的内容。
To remove a directory, the parent of that directory must be writable by the effective user. The
write
andexecute
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.