Linux – Recursively chmod directories only

It has always been my problem having to set permissions of files or folders selectively unitl I found a post in movabletripe.com. This trick is invaluable that I decided to repost it on this site as a backup.

find . -type d -exec chmod 755 {} \;

This will recursively search your directory tree (starting at dir ‘dot’) and chmod 755 all directories only.

Similarly, the following will chmod all files only (and ignore the directories):

find . -type f -exec chmod 644 {} \;

Please visit the original post.

2540 = 2537 = 2553

About the Author

Ver Pangonilo

A Filipino Engineer, Registered Professional Engineer of Queensland (RPEQ) – Australia and Professional Electrical Engineer (PEE) – Philippines with extensive experience in concept select, front-end engineering, HV & LV detail design, construction and commissioning of Hazardous and Non-Hazardous Area electrical installations in water and waste water pipeline and pumping facilities, offshore platforms, hydrocarbon process plants and pipelines including related facilities. Hazardous area classification and design certification (UEENEEM015B, UEENEEM016B, UEENEEM017B).

Facebook Auto Publish Powered By : XYZScripts.com