title: unix- show the second line of the file
body: <p>this command displays the second line of the file :</p>
  
  <pre><code>cat myfile | head -2 | tail -1
  </code></pre>
  
  <p>My file contains the following data : </p>
  
  <pre><code>hello
  mark
  this is the head line
  this is the first line 
  this is the second line 
  this is the last line
  </code></pre>
  
  <p>the command above prints the data as: <code>mark</code></p>
  
  <p>But i am unable to understand this because, head -2 is used to print the first two lines and tail  -1 prints the last line but how come 2nd line is printed!!???</p>