recursive grep

andrew.m.shaw ams at cbnewsl.ATT.COM
Thu Aug 24 03:22:34 AEST 1989


>>Here is a short quicky (I hope).  I am trying to do the following:
>>
>>find . -type d -exec grep string {}/* \;

>...why not do this:
>
>	find . -type f -exec grep string {} \;
>

No, find does not expand {} unless isolated.  Why not use the the much
ignored xargs and save yourself n execs of grep?  Thus:

	find . -type f -print | xargs grep string



More information about the Comp.unix.wizards mailing list