Changing directory permissions depending on file type
Posted on 2004-09-28
I have a dir, say /mydir, with literally hundreds of other subdirs in it. Probably thousands.
I want to assign 775 permissions to every dir under /mydir, and 664 to every file. This needs to be recursive, as some dirs under /mydir also have several subdirs inside.
#chmod 775 * -R
but this changes EVERYTHING at once. I don't know how to discriminate among dirs an files.
I'm sure this can be done with a shell script, but I'm not very versed in shell scripting.
If no one has an already made script, I could definitely use some pointers.