Skip to content


Recursive Chmod Tricks

Recursively chmod only directories

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

Similarly, recursively set the execute bit on every directory

chmod -R a+X *

The +X flag sets the execute bit on directories only

Recursively chmod only files

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

Recursively chmod only PHP files (with extension .php)

find . -type f -name '*.php' -exec chmod 644 {} \;

Popularity: 29% [?]

Posted in Snippets, SysAdmin.


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. ing_uu_mm says

    saved my day. thanks a lot

  2. girl_on_fly says

    Awesome! Thank you!



Some HTML is OK

or, reply to this post via trackback.