Answers:
为此,您可以使用find命令并搜索带有.sh扩展名的所有文件,然后chmod在找到的每个文件上运行命令:
find /directory/of/interest/ -type f -iname "*.sh" -exec chmod +x {} \;
信息:
-type f:仅普通文件(跳过目录,符号链接,命名管道和套接字,以及在/ dev中找到的特殊文件)-iname:忽略名称中的大小写"*.sh":通配,告诉find命令搜索扩展名为“ .sh”的文件-exec chmod +x {}:这告诉命令对找到的每个文件find执行chmod命令。使每个可执行文件\;:指示命令结束
find,也许xargs。