title: How can I get a range of line every nth interval using awk, sed, or other unix command?
body: <p>I know how to get a range of lines by using awk and sed.
  I also do know how to print out every nth line using awk and sed.</p>
  
  <p>However, I don't know how to combined the two.</p>
  
  <p>For example, I have a file with 1780000 lines.</p>
  
  <p>For every 17800th line, I would like to print 17800th line plus the two after that.</p>
  
  <p>So if I have a file with 1780000 lines and it starts from 1 and ends at 1780000, this will print:</p>
  
  <pre><code>1
  2
  3
  17800
  17801
  17802
  35600
  35601
  35602
  # ... and so on.
  </code></pre>
  
  <p>Does anyone know how to get a range of line every nth interval using awk, sed, or other unix command?</p>