Advertisement

05.24.2008 at 09:13PM PDT, ID: 23430932
[x]
Attachment Details

How to find files/folders which have writable permission ?

Asked by smksa in Linux, Linux Programming, Computer Servers

Tags: linux, bash, unix

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
 
Keywords: How to find files/folders which have …
 
Loading Advertisement...
 
[+][-]05.24.2008 at 09:22PM PDT, ID: 21641460

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Linux, Linux Programming, Computer Servers
Tags: linux, bash, unix
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628