Archive for July, 2008

Chmod

// July 9th, 2008 // Comments Off // Linux/Unix, Tutorial

NOTE TO SELF!

chmod 644 `find . -type f -iname “*.php”`

- “.” is the root folder/path you want to mass chmod

- f is for files

- .php is for file extension

chmod 755 `find . -type d`

- “d” is for directory

 

added by rix:

Another alternative,

find . -type f -name \*.php -exec chm0d 644 {} \;
-name = case-sensitive
-iname = case-insensitive

find . -type d -maxdepth 1 -exec chm0d 755 {} \;
-maxdepth = decide how deep into folders you’re going or remove them entirely for all folders