find /path/to/base/dir -type d -exec chmod 755 {} + find /path/to/base/dir -type f -exec chmod 644 {} +