Grep whole directory recursively by file extension only

Using grep to scan thru a whole directory recursively is done with:

grep -R 'string' dir/

In addition, you can also tell grep to only scan files that have a certain extension (or pattern, for that matter):

grep -R 'string' --include *.cpp dir/

 


Thanks for reading! Please consider Buying me a Coffee or checking out Colibri!