Here’s how to apply one set of permissions to all files, and a different set of permissions to all directories, in Linux (example):
First cd to the directory containing the subdirectories and files you want to change. Then:
For directories:
find . -type d -exec chmod 755 {} \;
For files:
find . -type f -exec chmod 644 {} \;
(You’ll need to change the 755 and 644 to the actual permissions you want, obviously.)