This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: find -exec oddity
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Mon, 07 Jul 2003 20:02:08 -0700
- Subject: Re: find -exec oddity
- Organization: My own little world...
- References: <3F0A045D.7030009@alltel.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/