title: Using sed to remove lines till the end of the file
body: <p>I'm using <code>sed -n '/[test1]/,/[test2]/{/[test2]/!p}' test.txt &gt; temp.txt</code>  ..which works well if If I only want the top selection, but I'm after the bottom section.</p>
  
  <pre><code>[test1]
  A
  B
  C
  [test2]
  1
  2
  3
  </code></pre>
  
  <p>But I'm after [test2] onwards, so Copying [test2] till the end of the line. So producing an output like so,</p>
  
  <pre><code>[test2]
  1
  2
  3
  </code></pre>