apply grep recursively
August 5th, 2007 by Lawrence David
i was always too dumb to get the “-R” option of grep working correctly so that i could apply grep recursively. finally, i came across a simple workaround that uses find and xargs:
find ./ -name “*.py” | xargs grep “my_pattern”
You can also type
find ./ -name “*.py†-exec grep “my_pattern†-H {} \;