tags:

views:

447

answers:

3

how do i recursively grep all directories and subdirectories ?

find . | xargs grep "texthere" *
+12  A: 
grep -r "texthere" .
Vinko Vrsalovic
A: 

Also:

find ./ -type f | xargs grep "foo"

but grep -r is a better answer.

Kurt
+3  A: 

Or install ack, if you want a much faster way and are doing this a lot.

Andrew McGregor
+1 for ack (AKA "ack-grep" on some distros). It's `grep -r` on steroids.
ZoogieZork