title: sed : delete all lines NOT containing string A or B, starting at 2nd line
body: <p>Please help - I'm stuck.</p>
  
  <p>I need to </p>
  
  <ol>
  <li>delete all lines of a textfile</li>
  <li>which does NOT contain foo or Foo </li>
  <li>starting from the 2nd line of the file</li>
  </ol>
  
  <p><strong>infile</strong>:</p>
  
  <pre class="lang-none prettyprint-override"><code>first line 
  foobar 
  tree 
  fish
  Foo Bar
  Football
  Foobar
  Street
  foo bar
  </code></pre>
  
  <p><strong>outfile</strong>:</p>
  
  <pre class="lang-none prettyprint-override"><code>first line
  foobar
  Foo Bar
  Football
  Foobar
  foo bar
  </code></pre>
  
  <p>I tried the following:</p>
  
  <p><code>sed '2,$/*.foo.*\|.*Foo.*/!d' -i test.txt</code></p>
  
  <p>The resulting error is:</p>
  
  <blockquote>
    <p>sed: -e expression #1, char 4: unknown command: `/'</p>
  </blockquote>
  
  <p>What's my mistake?
  (awk would be a possible alternative, too.)</p>