Tag: shell
chmod recursively on directories or files using find
by Mark on May.06, 2009, under sysadmin
Sometimes its the little things that annoy us so much on the Unix command line. One big question for me was… How to do you differentiate between directories and files when recursively chmod-ing?
The answer is simple. But of course there are different ways to do the same thing.
Using the find command
find -name '*' -type d -exec chmod 0755 {} \;
NOTE: the -name ‘*’ parameter is used to keep from modifying the present working directory or ‘.’ directory.
find . -type f -exec chmod 0644 {} \;