title: Is it possible to show grep output of +/- 3 words of the search keyword?
body: <p>I want to store information in a text file and use grep to search.
  With the command <code>grep -in &lt;keyword&gt; &lt;file&gt;</code>, I can show the line number and the line contains the keyword. However, the output will be sometime less readable if the line contains a long line of text.</p>
  
  <p>Is it possible to show the grep command output with +/- 3 words of the search result instead of the whole line?</p>
  
  <p>I am trying to get the result like<br />
  <code>$grep -in linux grep_test.txt</code><br />
  1: A <strong>Linux</strong>-based system is a<br />
  1: monolithic kernel, the Linux kernel, which handles<br />
  3: part of most <strong>Linux</strong>-based systems, providing<br />
  3: used by most <strong>Linux</strong> systems is built<br />
  3: More recently, the <strong>Linux</strong> community seeks to<br /></p>
  
  <p><a href="https://i.stack.imgur.com/Ai5qN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ai5qN.png" alt="enter image description here"></a></p>