Change file permissions with many levels of sub-directories

Sometimes you need to set o+x to all sub directories recursively, but don’t want to set that for any files. (chmod -R o+x * is overkill…) Here is how.

find dir -type d -exec chmod o+x {} ';'

Similarly you can set permissions for all files under the sub-directories.

find dir -type f -exec chmod o+r {} ';'

ref link:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your 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 )

Connecting to %s