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: http://superuser.com/questions/208606/how-to-change-file-permissions-for-a-directory-in-one-command

Leave a Reply

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

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 )

Connecting to %s