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

Post Reply
a24uall
Site Admin
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am

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

Post 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 {} \;
Arun
WebhostingDevelopment.com
a24uall
Site Admin
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am

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

Post 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
Arun
WebhostingDevelopment.com
Post Reply

Return to “Useful Commands”