[Scottish] Best way to find text within files recursively?
David Marsh's list-reading hat
scottish at mailman.lug.org.uk
Tue Jan 21 19:35:07 2003
On Sun, 19 Jan 2003 23:19:08 -0000
"Michael Cameron" <Michael.Cameron@Galston.co.uk> wrote:
> I'd go for:
> find . -type f -exec grep 'foo' {} /dev/null \;
>
> or possibly:
> find . -type f -exec grep -q 'foo' {} \; -print
I'm not too hot on the -exec syntax for find (this may explain why I can
never get that part to work and start piping things to xargs, perhaps
unnecessarily!), I suspect it's the "\;" that I have problems with:
what's that all about, or is it just "the rule" that you must finish
your -exec "clause" with it?
Thanks,
David.
--
David Marsh, <email valid @time of writing> | http://web.viewport.co.uk/