How do I display the 10th line of a file?

Tâm Tây

New member
How do I display the 10th line of a file?
Answer
Below are three great ways to get the nth line of a file in Linux.
  1. head / tail. Simply using the combination of the head and tail commands is probably the easiest approach. …
  2. sed. There are a couple of nice ways to do this with sed . …
  3. awk. awk has a built in variable NR that keeps track of file/stream row numbers.
 

Tìm kiếm

Back
Top