title: Fastest way to print a single line in a file
body: <p>I have to fetch one specific line out of a big file <em>(1500000 lines)</em>, multiple times in a loop over multiple files, I was asking my self what would be the best option <em>(in terms of performance)</em>. 
  There are many ways to do this, i manly use these 2</p>
  
  <pre><code>cat ${file} | head -1
  </code></pre>
  
  <p>or</p>
  
  <pre><code>cat ${file} | sed -n '1p'
  </code></pre>
  
  <p>I could not find an answer to this do they both only fetch the first line or one of the two <em>(or both)</em> first open the whole file and then fetch the row 1?</p>