Recursively Change File Permissions on Folders Only – Linux/Unix

Leave a comment

Problem

You want to recursively change all of the file permissions only on folders & subfolders in a directory, but not the files (or vice-versa: you want to change the permissions on files only, not folders).

Solution

This command will recursively search your current directory and chmod all directories & sub-directories only:

cd /yourdirectory

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

The following command will chmod all files only (ignoring the directories):

cd /yourdirectory

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

Solution Credit: MovableTripe

Update WordPress Without FTP

4 Comments

Problem

You want to update your WordPress installation or plugin automatically, but do want to setup FTP access on your server installation (or your hosting provider does not provide access).

Solution

Add the following line to your wp-config.php file:

define(’FS_METHOD’,’direct’);

WordPress will now update directly without requiring FTP access.