Jan 28 2022

To recursively give directories read&execute privileges:

find /path/to/base/dir -type d -exec chmod 755 {} +

To recursively give files read privileges:

find /path/to/base/dir -type f -exec chmod 644 {} +

Or, if there are many objects to process:

chmod 644 $(find /path/to/base/dir -type f)
chmod 755 $(find /path/to/base/dir -type d)

Find files with permissions

find /path -perm 755

Change directories permissions from 750 to 755

chmod 755 $(find /path -type d -perm 750)

Change files permissions from 740 to 644

chmod 644 $(find /path -type f -perm 740)

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.