to grep recursively only in files with certain extensions I use: grep STRING `find ./ -name '*.XXX'`