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 {} \;
Written by Alexander Woerndl
Related protips
1 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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Terminal
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#