简体   繁体   English

如何更改某些文件的文件权限?

[英]How to change file permissions of certain files?

chmod u+x filename

I know this is the command for adding x to users, but I don't have a filename. 我知道这是向用户添加x的命令,但是我没有文件名。 I want to use this command for all files containing certain letters in their name. 我想对所有名称中包含某些字母的文件使用此命令。 For example, i want to give perm to all files containing the letter "o" . 例如,我想为所有包含字母"o"文件提供烫发。 How do I do it? 我该怎么做?

I tried combining it with find but no luck... 我尝试将其与查找结合起来,但没有运气...

find . -name"*O**o*" chmod u+x

您需要添加-i来使匹配大小写不区分大小写。

find . -name -i "*o*" -exec chmod u+x {} \;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM