LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Limits of grep?

[ILUG] Limits of grep?

Subba Rao subb3 at attglobal.net
Sat Sep 30 23:29:13 IST 2000


On  0, Fergal Daly <fergal at esatclear.ie> wrote:
> At 06:29 30/09/00, Subba Rao wrote:
> > > This will go wrong on any file that has a space or a shell meta character
> > > and may even end abruptly. To avoid this use
> > >
> > > find . -print0 | xargs -0 grep "pattern"
> > >
> > > find will output the filenames in null separated format and xargs will
> > > expect them like that,
> > >
> >
> >Thanks for replying. I tried the following solution and works much faster.
> >
> >find <path> -print | xargs -n 500 grep <pattern>
> >
> >Thanks to everyone who replied with a solution!
> 
> Does this work much faster than find <path> -print0 | xargs -0 -n 500 grep 
> <pattern> ? The difference between them should be negligible,
> 

Yes. It is negligible difference. It depends on the current state of the
process activity. With all things being equal the command sequence

$ find <path> -print0 | xargs -0 -n 500 grep <pattern>

performs better, but only with a few microseconds.

-- 

Subba Rao
subb3 at attglobal.net
http://pws.prserv.net/truemax/




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell