Showing posts with label chmod for directory or files. Show all posts
Showing posts with label chmod for directory or files. Show all posts

Tuesday, 10 July 2012

set chmod for directory/files

Recursively chmod only for directory
find . -type d -exec chmod 755 {} \;
Recursively setting chmod on every directory for execting
chmod -R a+X *
Above +X flag is used to set execute bit for directories only.
Recursively chmod setting only for files.
find . -type f -exec chmod 644 {} \;
Recursively set chmod only for PHP files which have extensions (.php)
find . -type f -name '*.php' -exec chmod 644 {} \;