在 Bash 中设置文件属性

Set file attributes in Bash

在bash我想设置文件权限。

我正在尝试这个:

find ./GMDS_SRC/* -name '*.h' -o -name '*.c' -type f -exec chmod 444 {} \;

但只使用了最后一个参数 (*.c)。

这是为什么?更重要的是。我该如何解决?

find ./GMDS_SRC/* \( -name '*.h' -o -name '*.c' \) -type f -exec chmod 444 {} \;

( 表达式 ): 如果表达式为真则为真。
expression -o expression:初选交替;或运算符。如果第一个表达式为真,则不应计算第二个表达式。*

圆括号以反斜杠 () 为前缀,以防止被 shell.

计算