[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Quit after finding first N files
From: |
James Youngman |
Subject: |
Re: Quit after finding first N files |
Date: |
Thu, 11 Mar 2010 23:53:32 +0000 |
On Mon, Mar 8, 2010 at 3:47 PM, Nexor <address@hidden> wrote:
> Thanks James,
>
>>> Thank you so much for the detailed response. I didn't know I can
>>> simply use 'head' to get what I need.
>>
>> There is a difference between the two approaches. Writing through
>> a pipe to "head -8" will kill the writer when the 9th result is
>> printed. If the cost of finding an additional match is significant
>> (or only N matches exist) then there is a potential waste of resources
>> involved in finding the extra match. For most uses this is not a big
>> deal and the approach using "head" works just fine.
>
> Do you think it would make sense to implement (yet) another option to
> find?
No. As I mentioned before, there are already two different ways to
do this, neither of which requires changing find.
> It could be something like -maxresults N and would do exactly
> that - stop the search after finding N matches.
> I use it for generating a report for the administrator - I don't need
> full results because they are not processed automatically anyway. I'm
> not sure if more people could find something like maxresults usable.
>
> cheers,
> Tomek
>
>
>