Searching through code

Sure, if you’re on windows you can turn on the ‘search inside File Contents’ option, but it’s slow and annoying. ¬†Far better is to get your code on linux and run this:

find ./src -exec grep "Search Term" '{}' \; -print

The second term is the directory to search in. The “Search Term” is what you are hoping to find in one of the files in the search directory. The search term will be matched exactly and files in all sub-folders will be checked. Super handy.

2 thoughts on “Searching through code

Leave a Reply

Your email address will not be published. Required fields are marked *

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