[英]Ubuntu how to give read permission only for owner
我只需要授予目录和子目录所有者的读取权限。没有其他用户可以读取目录中的文件。如何在命令行中执行此操作
chmod -R 700 directory_name
递归地为您自己设置所有权限,其他则不保留。
You can use the find
command for this: 您可以为此使用find
命令:
find -type d -exec chmod 0500 {} \;
Note that read permissions only will not work for a directory to list it's contents. 请注意,仅读取权限对目录列出其内容无效。 Additionally the executable permission must be given. 此外,必须提供可执行权限。 Therefore 0500 因此0500
尝试这个 :
chmod -R 700 yourDir
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.