title: grep regex : extract pattern from all files in a directory
body: <p>Lets say a directory has two files. Here are the contents</p>
  
  <p>File1.txt</p>
  
  <pre><code>tagstart random string tagend
  
  tagstart random string tagend
  </code></pre>
  
  <p>File2.txt</p>
  
  <pre><code>tagstart random string tagend
  
  tagstart random string tagend
  </code></pre>
  
  <p>I want to grep the directory and extract the lines that have the following pattern</p>
  
  <pre><code>tagstart &lt;any string&gt; tagend
  </code></pre>
  
  <p>I also want to pipe the output to another file. Basically the grep command will result in an output file like this</p>
  
  <p>out.txt</p>
  
  <pre><code>tagstart random string tagend
  
  tagstart random string tagend
  
  tagstart random string tagend
  
  tagstart random string tagend
  </code></pre>