this command displays the second line of the file:
cat myfile | head -2 | tail -1
My file contains the following data:
hello mark this is the head line this is the first line this is the second line this is the last line
the above command displays the data as follows: mark
But I canβt understand this, because head -2 is used to print the first two lines, and tail -1 prints the last line, but how does the second line get! ???
unix
Chandeep
source share