tag:selfsolved.com,2005:/problems/set-execute-permission-for-direc/sSolutions for: Set execute permission for directories | SelfSolveda SelfSolved feed2011-08-07T10:11:13Z1SelfSolvedtag:selfsolved.com,2005:Array/69923141736420yliu
chmod -R g+rx ., use chmod -R g+rX .
The capitalized X sets the executable bit only if the target is a directory. Per the man page:
The execute/search bits if the file is a directory or any of the execute/search bits are set in the original (unmodified) mode. Operations with the perm symbol ``X'' are only meaningful in conjunction with the op symbol ``+'', and are ignored in all other cases.
So you can't use it to remove executable bits on directories, but definitely can use it to set the executable permission bit.]]>