Archive for category Linux/Unix

Set permission to files, folders and subfolders in Shell

Hi,

I  searched google to find out the exact shell command for setting permission to files , folder and all sub folders in one command :

Normally in web Server all folders and sub folders would have 755 permission  Write in your shell.

Command : $ find /var/www -type d -perm 777 -print -exec chmod 755 {} \;

If you want to set all files  permission 644 those have 777 , write in shell:
Command : find /var/www -type f -perm 777 -print -exec chmod 644 {} \;

Ref :http://www.cyberciti.biz/faq/howto-apply-conditional-recursive-chmod-file-permissions/

, ,

Leave a comment