find /path/to/dir -type d -print | xargs chmod 775
find /path/to/dir -type f -print | xargs chmod 664