title: How do I fetch lines before/after the grep result in bash?
body: <p>I want a way to search in a given text. For that, I use <code>grep</code>:</p>
  <pre><code>grep -i &quot;my_regex&quot;
  </code></pre>
  <p>That works. But given the data like this:</p>
  <pre><code>This is the test data
  This is the error data as follows
  . . . 
  . . . .
  . . . . . . 
  . . . . . . . . .
  Error data ends
  </code></pre>
  <p>Once I found the word <code>error</code> (using <code>grep -i error data</code>), I wish to find the 10 lines that follow the word <code>error</code>. So my output should be:</p>
  <pre><code>. . . 
  . . . .
  . . . . . . 
  . . . . . . . . .
  Error data ends
  </code></pre>
  <p>Are there any way to do it?</p>