title: grep for X or Y in unix?
body: <p>how can I capture all lines from a text file that begin with the character "X" or contain the word "foo"?</p>
  
  <p>This works:</p>
  
  <pre><code>cat text | grep '^@'  # begins with @
  </code></pre>
  
  <p>but I tried:</p>
  
  <pre><code>cat text | grep '^@|[foo]' 
  </code></pre>
  
  <p>and variations but cannot find the right syntax anywhere.  how can this be done?</p>
  
  <p>thanks.</p>