Change rights and owners of linux recursively

When you spend half of your working life installing Joomla, WordPress and other free softwars on different servers, always end by hitting with the issue of rights. I can not upload files to some folder, with Plesk if I can not change the owner or I can not do it recursively or I have to do it with FTP… When you are lucky enough to have the server near you or you can conect through SSH or remotely, the topic changes. Here are some commands that are always helpful in UNIX.

Change permissions on files and directories recursively:

find . -type f -exec chmod 644 {} \ ;

find . -type d -exec chmod 755 {} \ ;

Change user and group recursively:

chown -R apache:www .