How can I grep recursively, but only in files with certain extensions?
Just use the –include parameter, like this: grep -inr –include \*.h –include \*.cpp CP_Image ~/path[12345] | mailx -s GREP email@domain.example That should do what you want. To take the explanation from HoldOffHunger’s answer below: grep: command -r: recursively -i: ignore-case -n: each output line is preceded by its relative line number in the file –include … Read more