title: Is it more efficient to grep twice or use a regular expression once?
body: <p>I'm trying to parse a couple of 2gb+ files and want to grep on a couple of levels.</p>
  
  <p>Say I want to fetch lines that contain "foo" and lines that also contain "bar".</p>
  
  <p>I could do <code>grep foo file.log | grep bar</code>, but my concern is that it will be expensive running it twice.</p>
  
  <p>Would it be beneficial to use something like <code>grep -E '(foo.*bar|bar.*foo)'</code> instead?</p>