This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problem with find's -size and -exec options


On 5/14/2012 5:29 PM, j. k. colligan wrote:

I just noticed a difference in behavior between Cygwin's "find" and
the one in Linux, or
so it seems.

I was trying to locate files smaller than a given size, and thus ran

find . -size -4000c

That worked, and listed the file names only for files<  4000 bytes in
size.  But if I run

find . -size -4000c -exec ls -l {} \;

it turns out that *all* files are listed!

Looks like the problem is that find returns directories.


Try "find -type f -size -4000c -ls"

(yes, find already has ls built in, no need to use exec).
--
René Berber


-- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]