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

Fred James fredjame at concentric.net
Thu Jan 30 23:43:45 CST 2003


I vote for the "2 days figuring out the unix options" - otherwise I 
might be always stuck with the MS options.
Interestingly enough, if one can write all the files to a text file, why 
not then use awk, grep, or sed, on the file (take your pick, or mix and 
match to your heart's content).

Mike wrote:

>Since this appears to be a onetime effort and to quickly get 
>this done:
>
>ll > directorylist.txt
>
>then open directorylist.txt in a spreadsheet with fixed 
>width fields and mask out the read only files with 
>filtering
>
>OR 
>
>you could spend another 2 days figuring the unix options to 
>
>On Thursday 30 January 2003 07:49 pm, 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
>>
>
>
>_______________________________________________
>https://ntlug.org/mailman/listinfo/discuss
>
>

-- 
find . -type f | xargs file | grep -i text | cut -f1 -d: | xargs grep "..."






More information about the Discuss mailing list