How to change permission of all files and folders at once

To set permission of all files on the server to 644 & folders to 755 is quite simple.

To change the permissions of all folders to 755 you can use the command below :

find ./ -type d -print0 | xargs -0 chmod 0755

To change the permissions of all files to 644 you can use the command below :

find ./ -type f -not -name "*.pl" -not -name "*.cgi" -not -name "*.sh" -print0 | xargs -0 chmod 0644

That’s it.