title: How do I grep recursively in files with a certain extension?
body: <p>To find all file paths with <code>.out</code> extension in subdirectories,  I use</p>
  
  <pre><code>find . -name '*.out'
  </code></pre>
  
  <p>To grep a pattern in all files ending in <code>.out</code>, I use</p>
  
  <pre><code>grep pattern *.out
  </code></pre>
  
  <p>How do I combine these two commands, so that it finds all files and then greps in those files?</p>
  
  <p>I am looking for an elegant alternative to</p>
  
  <pre><code>grep -r 'pattern' . | grep '.out'
  </code></pre>