grep -Irl --include=\*.txt "keyword" .
or
find . -type f -print0 | xargs -0 grep "keyword"
Recursively search a directory for files containing "this" and replace it with "that":
find . -type f -print0 | xargs -0 sed -i 's/this/that/g'
or
sed -i 's/this/that/g' `grep -lR --include=\*.txt 'this' .`
If you are on a Mac:
find . -name '*.txt' | xargs perl -pi -e 's/this/that/g'