The easiest way is to do:
chmod -R u+rwX,go+rX,go-w /path/to/dir
which basically means:
to ch
ange file mod
es -R
ecursively by giving:
u
ser: r
ead, w
rite and eX
ecute permissions,g
roup and o
ther users: r
ead and eX
ecute permissions, but not -w
rite permission.Please note that X
will make a directory executable, but not a file, unless it's already searchable/executable.
+X
- make a directory or file searchable/executable by everyone if it is already searchable/executable by anyone.
Please check man chmod
for more details.
See also: How to chmod all directories except files (recursively)? at SU