[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Quit after finding first N files
From: |
Nexor |
Subject: |
Re: Quit after finding first N files |
Date: |
Mon, 8 Mar 2010 15:47:02 +0000 |
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? 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