如何更改某些文件模式/扩展名的权限? [英] How to change permissions to certain file pattern/extension?
本文介绍了如何更改某些文件模式/扩展名的权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用chmod
,我在当前目录中执行chmod +x *.sh
,但是如果我想更改所有文件,包括具有sh文件扩展名的子文件夹中的文件,该怎么办?.
Using chmod
, I do chmod +x *.sh
in the current directory but what if I want to change all files including files within subfolders that has an sh file extension?.
chmod +x -R *
可以工作,但我需要更像chmod +x -R *.sh
chmod +x -R *
will work but I need something more like chmod +x -R *.sh
推荐答案
使用查找:
find . -name "*.sh" -exec chmod +x {} \;
这篇关于如何更改某些文件模式/扩展名的权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文