title: Get the contents of a line by line number in perl, awk, grep
body: <p>I would like to know if it's possible to get contents of line by line number as input. For example how can I get the contents of line 314 using a tool such as <code>perl</code>, <code>grep</code>, <code>awk</code>.</p>
  
  <p>I have few options I have tried</p>
  
  <ol>
  <li><p>Counting till the line number in <code>perl</code> and printing - not the most efficient</p></li>
  <li><p>If I know the pattern in the line find line number using <code>grep -in "pattern" file</code>.</p></li>
  </ol>
  
  <p>But something like vim <code>:314</code> is what I'm expecting using <code>perl</code>, <code>awk</code>, <code>grep</code>.</p>