This command will search for text inside files in a directory while excluding some directories you do not want to search in.
This is helpful when a search is going slow due to a directory that might contain thousands of files that you are not interested in searching through, such as an images or cache directory.
grep -r –exclude-dir=product_images –exclude-dir=cache –exclude-dir=.svn search term *