执行find ./ -name "*.sh*"
可以查找目录下全部的可执行文件(.sh)
chmod a+x
可以给文件添加执行权限
那么结合使用 -type f -exec chmod a+x {} +
即下面的命令便可查找出目录下全部可执行文件(.sh)并添加执行权限
find ./ -name "*.sh*" -type f -exec chmod a+x {} +
当然暴躁一点可以直接前往父目录,给整个文件夹赋予执行权限
使用chmod a+x
命令
以test文件夹为例子
cd ..
chmod a+x ./test/
同理还可以找到全部json文件并删除
find ./ -name "*.json*" -type f -exec rm -rf {} +