title: 'grep +A': print everything after a match
body: <p>I have a file that contains a list of URLs. It looks like below:</p>
  <p>file1:</p>
  <pre><code>http://www.google.com
  http://www.bing.com
  http://www.yahoo.com
  http://www.baidu.com
  http://www.yandex.com
  ....
  </code></pre>
  <p>I want to get all the records after: <a href="http://www.yahoo.com" rel="nofollow noreferrer">http://www.yahoo.com</a>, results looks like below:</p>
  <p>file2:</p>
  <pre><code>http://www.baidu.com
  http://www.yandex.com
  ....
  </code></pre>
  <p>I know that I could use grep to find the line number of where yahoo.com lies using</p>
  <pre><code>grep -n 'http://www.yahoo.com' file1
  
  3 http://www.yahoo.com
  </code></pre>
  <p>But I don't know how to get the file after line number 3. Also, I know there is a flag in grep -A print the lines after your match. However, you need to specify how many lines you want after the match.  I am wondering is there something to get around that issue. Like:</p>
  <pre><code>Pseudocode:
  
  grep -n 'http://www.yahoo.com' -A all file1 &gt; file2
  </code></pre>
  <p>I know we could use the line number I got and <code>wc -l</code> to get the number of lines after yahoo.com, however... it feels pretty lame.</p>