Add to Favourites Add to Favourites    Print this Article Print this Article

I need to see the Nth line in a file

If you want to extract just the th line in a , you can use both head and tail to grab it, eg:

head -n 5 file.txt | tail -n 1



Was this answer helpful?

Also Read