Last Updated: February 25, 2016
· wrndl

Change file rights for files / directories only

Go to the parent directory of the files and directories you want to change and execute the following commands.

For directories only do this:

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

For files only do this:

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

1 Response
Add your response

If that's only about difference in x flag, that's easier to use

chmod -R u=rwX,go=rX .

That is, using capitalized X. It means setting executable flag for directories only or if x is already set.

man chmod
over 1 year ago ·