Aru*_*ava 28 command-line chmod executable sh
尝试对目录中的所有 .sh 文件执行递归 chmod 以使它们可执行
Geo*_*sen 42
为了使这成为可能,您可以使用该find
命令并搜索所有带有.sh
扩展名的文件,然后chmod
对找到的每个文件运行该命令:
find /directory/of/interest/ -type f -iname "*.sh" -exec chmod +x {} \;
Run Code Online (Sandbox Code Playgroud)
信息:
-type f
: 仅普通文件(跳过目录、符号链接、命名管道和套接字以及 /dev 中的特殊文件)-iname
: 忽略名称中的大小写"*.sh"
: Globbing,告诉find
命令搜索带有“.sh”扩展名的文件-exec chmod +x {}
:这告诉命令对每个找到的文件find
执行chmod
命令。制作每个可执行文件\;
: 指示命令结束 归档时间: |
|
查看次数: |
40739 次 |
最近记录: |