Recursively changing permissions

For files:

$ find /home/user/demo -type f -perm 777 -print -exec chmod 755 {} \;

For directories:

$ find /var/www/html -type d -perm 777 -print -exec chmod 755 {} \;

Useful for when WordPress updates go wrong.

[Taken from here]

Correct(?) wordpress permissions

Files 744
Dir 755
wp-config.php 750