How to "find" all writable files in a directory tree?

Winston Gutkowski winston.gutkowski@eztext.com
Fri May 9 21:38:00 GMT 2003


Either should work fine. Had problems when I tried:
find <dir> -exec test -w {} && echo {} \;
because of confusion with "&", so just bunged the command in a file.
Also forgot the "-type f" of course... :-)
Winston
-----Original Message-----
From: Igor Pechtchanski [mailto:pechtcha@cs.nyu.edu]
Sent: Friday, May 09, 2003 14:22
To: Winston Gutkowski
Cc: cygwin@cygwin.com; Karr, David
Subject: RE: How to "find" all writable files in a directory tree?
Winston,
Most of this is off-topic, but why not simply
find <dir> -type f -exec test -w {} \; -print
?
Or, if you want something more complex,
find <dir> -type f -exec sh -c "test -w {} && echo {}" \;
HTH,
	Igor
On Fri, 9 May 2003, Winston Gutkowski wrote:
> I believe you need to use
> find <dir> -perm +222 -ls
>> Alternatively, put the following command:
> test -w 1ドル && echo 1ドル
>> into a file, make it executable, and try
>> find <dir> -exec <file> {} \;
>> HIH
>> Winston
>> -----Original Message-----
> From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
> Of Karr, David
> Sent: Friday, May 09, 2003 13:53
> To: cygwin@cygwin.com
> Subject: How to "find" all writable files in a directory tree?
>>> I need to find all the files in a directory tree that are writable. So,
> the "find" man page has the following text:
>> -------------------------
> -perm mode
> File's permission bits are exactly mode (octal or symbolic).
> Symbolic modes use mode 0 as a point of departure.
>> -perm -mode
> All of the permission bits mode are set for the file.
>> -perm +mode
> Any of the permission bits mode are set for the file.
> -------------------------
>> I'm not quite sure what this tells me. I guessed that "-perm +w" would
> do what I want. Unfortunately, when I use this it says:
>> find: invalid mode `+w'
>> I'm on Cygwin 1.3.22.
>> Am I misunderstanding what this man page says?

-- 
				http://cs.nyu.edu/~pechtcha/
 |\ _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_		igor@watson.ibm.com
 |,4- ) )-,_. ,\ ( `'-'		Igor Pechtchanski
 '---''(_/--' `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
Knowledge is an unending adventure at the edge of uncertainty.
 -- Leto II
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /