Chmod Recursively

To chmod recursively, meaning directories and all directories within, you’d use the -R option:

chmod -R 755

From the chmod man page:

-R, –recursive
change files and directories recursively

This is all simple enough, but for some reason I always forget it. So here it is.

You can also use find to CHMOD files and directories recursively.

Find files and change permissions to 644:

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

Find directories and change permissions to 755:

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

Post written by Ed Reckers

Founder and lead web development consultant at Red Bridge Internet : San Francisco WordPress Developers and Consultants.

Leave a Reply