[PLUG] Recursive grep

alan alan at clueserver.org
Mon Sep 23 12:24:24 UTC 2002


Modern versions of grep support the "-r" flag for recursion.  (At least 
the ones shipped in Redhat and Mandrake do.)

On Mon, 23 Sep 2002, Mike Witt wrote:

> When I want to grep through (for example) all the .c files in
> a hierarchy I've been using find, for example:
> 
>   find . -name \*.c -exec fgrep -H "find.this.string" {} \;
> 
> It SEEMS like I ought to be able to accomplish the same thing using
> grep recursively, something like: 
> 
>   grep -r "find.this.string" *.c
> 
> but I can't figure out any way to cause the "*.c" to be evaluated
> at the right time in order to actually run the grep on all the C
> files in the hierarchy.
> 
> Am I missing something, or is recursive grep only good for searching
> through ALL files in a hierarchy?
> 
> -Mike
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
> 





More information about the PLUG mailing list