Find All Directory or File (Recursively) Only And Execute Command (Chmod)

December 14, 2017

Apply chmod 755 to directory and sub-directories only (excluding files).

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

Apply chmod 644 to all files only (excluding directory).

find ./mydir -type f -exec chmod 644 {} \;
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.