如何更改文件​​权限到一定的文件模式到我的当前目录下的子文件夹? [英] How do I change file permission to a certain file pattern to sub folders of my current directory?

查看:144
本文介绍了如何更改文件​​权限到一定的文件模式到我的当前目录下的子文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用搭配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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆