printing matching lines when greping all files in a directory

Posted by John Kube on Super User See other posts from Super User or by John Kube
Published on 2010-04-03T18:37:00Z Indexed on 2010/04/03 18:43 UTC
Read the original article Hit count: 163

Filed under:
|
|
|
|

I'm searching within Java files for some occurrence of a phrase:

find . -name '*.java' | xargs grep -l 'string'

How do I change this command to print to the shell all of the lines which contain a match?

Thanks!

© Super User or respective owner

Related posts about grep

Related posts about unix