X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Date: Mon, 14 May 2012 18:29:57 -0400 Message-ID: Subject: problem with find's -size and -exec options From: "j. k. colligan" To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q4EMUvdL032331 Friends - 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!  (Plus the small ones at the end of the list.)  This surprised me.  In other similar cases I've run in the past, the earlier-in-the-command-line filters took effect before the exec. The Linux version of "find" doesn't operate that way:  in the latter case, only the "small" files are passed to ls.  And if one replaces "-4000c" with "+4000c", it works as I'd expect. And yeah, I tried escaping that minus sign for the Cygwin shell, a la     find . -size \-4000c -exec ls -l {} \; Same unexpected (to me) result.  Am I way outta whack here, of is this a real problem? Thanks! cheers, j. kev jkevinc AT gmail DOT com Monday, 2012.05.14 @ 1830 EDT -- 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