title: How can I grep recursively, but only in files with certain extensions?
body: <p>I'm working on a script to <a href="https://en.wikipedia.org/wiki/Grep" rel="noreferrer"><code>grep</code></a> certain directories:</p>
  <pre><code>{ grep -r -i CP_Image ~/path1/;
  grep -r -i CP_Image ~/path2/;
  grep -r -i CP_Image ~/path3/;
  grep -r -i CP_Image ~/path4/;
  grep -r -i CP_Image ~/path5/; }
  | mailx -s GREP email@domain.example
  </code></pre>
  <p>How can I limit results only to extensions <strong><code>.h</code></strong> and <strong><code>.cpp</code></strong>?</p>