Unix/Linux – chmod recursive

by

>How do you set all directories and subdirectories in a given directory to
>775.
>For example I want to do a ‘chmod -R 775 *’ but I want it to effect
>directories only.
>I would also like to do ‘chmod -R 664 *’ but only affect files, not
>directories.

chmod -R a+rX,g+w directory_name will do both.
X says– change to x permission only if it already has x permission for
owner, not otherwise.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: