Originally posted by: sourceninja
For the record, in case anyone searches for this problem in the future, I will answer it.
chgrp -R group /path/to/folder will set the group on a folder and all subfolders and files
chmod -R permissions /path/to/folder will do the same for permissions.
chown is done the same way and can be used to set users and groups.
Originally posted by: degibson
For nasty versions of chgrp, chmod, and chown that don't allow the useful -R function:
find /path/to/folder -type f -exec chmod [permissions] {} \;
If I'm setting the permissions using octals (eg 755, as opposed to g+w for example) then it's usually going to work better using the 'find' method. this is because you will typically want different permissions on your folders than you do on your files. Sometimes, even when using mode operators (eg g+w), you may want it to apply only to files or only to directories, in which cases the find method works well here, too.
For example, say you want everthing to be user writeable and group and world readable. If you just did 'chmod -R 644 /path/to/folder' than your directories would be inaccessible without the execute bit set. Likewise, if you do 'chmod -R 755 /path/to/folder' than all your files have the execute bit set and could be a security risk.
So for this case I would set permissions like this (run both lines):
chmod -R 644 /path/to/folder
find /path/to/folder -type d -exec chmod 755 '{}' \;