Lets say you want to change group permissions of all files and directories inside a directory. Following command can be used to do that:
chgrp -R groupname pathofdirectory
This command will only change the group of all files that you own. For the remaining ones, you will see a warning “Not a owner”.