Path: utzoo!attcan!uunet!cs.utexas.edu!csc.ti.com!ti-csl!tilde.csc.ti.com!pearl!pearl!mikep From: mikep@dirty.csc.ti.com (Michael A. Petonic) Newsgroups: comp.unix.misc Subject: Re: Fast file scan Message-ID: Date: 2 Oct 90 04:38:39 GMT References: <299@lysator.liu.se> <143198@sun.Eng.Sun.COM> Sender: news@pearl.dsg.ti.com (System News Administration) Distribution: comp Organization: Texas Instruments, Speech Mushrooms. Lines: 24 In-Reply-To: lm@slovax.Sun.COM's message of 1 Oct 90 00:48:50 GMT In article <143198@sun.Eng.Sun.COM> lm@slovax.Sun.COM (Larry McVoy) writes: >Lines: 14 > >In article <299@lysator.liu.se> pen@lysator.liu.se (Peter Eriksson) writes: >>I`d like to know how to scan all files in a directory (and it's sub- >>directories) for a specific string (without regular expressions) as fast >>as possible with standard Unix tools and/or some special programs. >> >>(I've written such a program, and would like to compare my implementation >>of it with others.) >> >>(Using the find+fgrep combination is slooooow....) >> >>Any ideas? > >I would probably use ftw(3). I've found it a useful tool. I can't see how find . -type f -print | xargs fgrep foobar is too slow... If there were any speed advantage in hand crafting a program to do the same, I'm not sure it would be worth doing so. -MikeP