复制执行权限(用户、组和其他之间)

问题描述 投票:0回答:1

我需要为那些具有用户执行权限的文件/子目录设置组/其他执行权限(在目录中递归)。

我该怎么做?

linux shell chmod
1个回答
0
投票

您可以将

find
命令与
-perm
选项和
chmod
命令结合使用。

find /home/user/mydir -type f -perm -u+x -exec chmod go+x {} \;
find /home/user/mydir -type d -perm -u+x -exec chmod go+x {} \;
© www.soinside.com 2019 - 2024. All rights reserved.