Page 1 of 1

Change permission of all the files to 644 and folders to 755

Posted: Sun Jul 01, 2012 3:54 pm
by a24uall
You can use the below commands to change all the file permission to 644
Login to the folder that you want file permission changed and issue the below command. This will recursively change all the file permission to 644.
find . -type f -exec chmod 644 {} \;
Login to the folder that you want folder permission changed and issue the below command. This will recursively change all the folder permission to 644.
find . -type d -exec chmod 755 {} \;

Re: Change permission of all the files to 644 and folders to

Posted: Sun Jul 01, 2012 3:55 pm
by a24uall
You may also use the below command to change the files and folder permission of all the users in a cpanel server.

Code: Select all

for i in `cat /etc/trueuserdomains| awk {'print $2'}`; do find /home/$i/public_html -type f -exec chmod 644 {} \;; find /home/$i/public_html -type d -exec chmod 755 {} \;; done