Link to home
Start Free TrialLog in
Avatar of poisa
poisaFlag for Canada

asked on

Changing directory permissions depending on file type

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.

I tried:

#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.

Thanks.
Poisa
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial