xargs still nok?

Alexander Gottwald alexander.gottwald@s1999.tu-chemnitz.de
Thu Sep 8 14:48:00 GMT 2005


On Thu, 8 Sep 2005, zzapper wrote:

> >yes, you should rather write
> >$ find . -name "*.cfm" -print0 | xargs -0 grep -i host
> 
> Is Xargs still reqd for
> 
> find . -name '*.cfm' -exec grep -i {} \;

This is a speed issue. find -exec will spawn grep for each found entry
while xargs will group as much files as possible and reduces the number
of required grep calls.

eg                             
grep host file1                       grep host file1 file2 ... file256           
grep host file2                vs     grep host file257 ... 
... 
grep host file123456

bye
	ago 
-- 
 Alexander.Gottwald@s1999.tu-chemnitz.de 
 http://www.gotti.org           ICQ: 126018723

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



More information about the Cygwin mailing list