Recursive grep

I always need it, and I always forget it. How to recursively search files containing a given string on unix:

grep -r "TABLE_NAME" . --include=*.sql

Written here for future memory.

Windows users have the dog performing searches, unfortunately it's not a smart one.


One Response to “Recursive grep”  

  1. 1 Luigi

    Another way that works on other unix environment (MINGW32), is using grep in combination with find:

    $ find . -name pom.xml -exec grep -Hi “log4j” {} \;

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



Calendar

September 2008
M T W T F S S
« Aug   Oct »
1234567
891011121314
15161718192021
22232425262728
2930  

Follow me

twitter flickr LinkedIn feed

Subscribe by email

Enter your email address:

Archives


Categories

Tag Cloud


Listening