Hi,
I would like to request an assistant.
I have a scripts that will find all files/folder inside the "public_html" folder and set the permission 755 for folders and 644 for files as follows :
find /home/username/public_html
-type d | xargs chmod -x 755
find /home/username/public_html
-type f | xargs chmod -x 644
find /home/username/public_html
-name *.cgi | xargs chmod -x 755
find /home/username/public_html
-name *.pl | xargs chmod -x 755
But, i would like the scripts to IGNORE the folder or FILES that have 777 as it permission .
Eg :
find /home/username/public_html
-type d | xargs chmod -x 755 | Except having 777 permission
find /home/username/public_html
-type f | xargs chmod -x 644 | Except having 777 permission
find /home/username/public_html
-name *.cgi | xargs chmod -x 755 | Except having 777 permission
find /home/username/public_html
-name *.pl | xargs chmod -x 755 | Except having 777 permission
Appreciates if somebody could help me with the correct command or scripts.
Thank you,
Regards,
Sham
Start Free Trial