[NTLUG:Discuss] how do I get a list of files that are set read-only?

Greg Edwards greg at nas-inet.com
Fri Jan 31 11:37:02 CST 2003


Greg Edwards wrote:
> Jack Snodgrass wrote:
> 
>>
>> I have a list of files ( lots of files... lots of sub directories. ) 
>> and I need to
>> find out which ones are read-only. find is supposed to have a -perm 
>> option
>> that seems like it would help, but I can't figure out how to run it.
>>
>> I could do a ls -lR and grep for something like -r-* ro dr-*  but
>> ls -lR would only tell me the file name and not the full path.
>>
>> I need to get a list of files ( full path ) that are read only.
>>
>> I accidently did a chmod +w on the files. I didn't want to do that.
>> I have another, similar directory that is set up like I need. I would
>> like to use that as a 'template' so to speak... get a list of files that
>> are read only so I can fix the directory that I messed up.
>>
>> Thanks - jack
>>
> 
> 
> find . -perm -a=w -print
> 
> Will show you any files from the current dir down that have no write 
> permission set at any level.
> 

oops, that should be

find . ! -perm +a=w -print

-- 
Greg Edwards
New Age Software, Inc.
http://www.nas-inet.com




More information about the Discuss mailing list