Recursively chmod specific files

Every now and then I need to chmod all my media files to make sure they are accessible by various things. Usually its only one filetype at a time eg. mp3s. The normal chmod -R 744 *.mp3 wont acomplish this so I use the following.

find . -iname '*.mp3' -exec chmod 744 {} \;

The command above will find all mp3s recursively starting from the current directory and give them permissions of 744. A couple of extra commands below.

find . -type f -exec chmod 755 {} \

The command above will find all the directories below this current directory and give them permissions of 755. This command wont alter the permissions of any files.

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

This command above will find all the files below this current directory and give them permissions of 744. This command wont alter the permissions of any directories.

Thanks weirdo for the help on this one 😀

m00nie