recursive grep

Arthur David Olson ado at elsie.UUCP
Tue Aug 29 07:22:25 AEST 1989


> . . .I recommend the following:
> 	find . -type f -print | xargs fgrep string

Using
	find . -type f -print | xargs fgrep string /dev/null
will help ensure that all files are treated consistently.  If xargs bunched
all but one of your files into its first exec of fgrep, then passed the last
file to fgrep, you'd get output such as
	firstfile: This is a string.
	secondfile: This is also a string.
	This is the last string.
with the first command above; you'd get output such as
	firstfile: This is a string.
	secondfile: This is also a string.
	thelastfile: This is the last string.
with the second command above.
-- 
Gettysburg Address: 266 words.  Spencer article bodies, 8/12-18/89: 14439 words.
	Arthur David Olson    ado at alw.nih.gov    ADO is a trademark of Ampex.



More information about the Comp.unix.wizards mailing list