Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <3F0A3430.276CF8A3@dessent.net>
Date: Mon, 07 Jul 2003 20:02:08 -0700
From: Brian Dessent <brian@dessent.net>
Organization: My own little world...
X-Accept-Language: en,en-US
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: find -exec oddity
References: <3F0A045D.7030009@alltel.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Ken Dibble wrote:

> I can't make sense of this.
> 
> $ find ./ -mtime -1  -print | wc -l
>     55
>
> $ find ./ -mtime -1  -exec ls -l  '{}' \; | wc -l
>   2046

Try running "find . -mtime -1" (-print is assumed) and look at the
output.  In addition to files, find returns directories that match the
criteria.  Add "-type f" if you only want files.  If you invoke "ls -l"
on a directory it prints the directory's contents rather than printing
its name -- you can supply it with "-d" if you wish for it to list
directory names insted of contents.  I think that's what you are seeing
here.

Brian

--
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/

