| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Message-ID: | <3F0A3430.276CF8A3@dessent.net> |
| Date: | Mon, 07 Jul 2003 20:02:08 -0700 |
| From: | Brian Dessent <brian AT dessent DOT net> |
| Organization: | My own little world... |
| X-Accept-Language: | en,en-US |
| MIME-Version: | 1.0 |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: find -exec oddity |
| References: | <3F0A045D DOT 7030009 AT alltel DOT net> |
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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |