find /path/to/directory -type f -exec chmod 664 {} ;
find /path/to/directory -type d -exec chmod 775 {} ;
sudo find /var/www/html -type d -exec chmod 755 {} ;