Fast file scan

Michael A. Petonic mikep at dirty.csc.ti.com
Tue Oct 2 14:38:39 AEST 1990


In article <143198 at sun.Eng.Sun.COM> lm at slovax.Sun.COM (Larry McVoy) writes:
>Lines: 14
>
>In article <299 at lysator.liu.se> pen at 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



More information about the Comp.unix.misc mailing list