Hoàng Minh An
New member
How do you display the nth line of a file in Unix?
Answer
Below are three great ways to get the nth line of a file in Linux.
Answer
Below are three great ways to get the nth line of a file in Linux.
- head / tail. Simply using the combination of the head and tail commands is probably the easiest approach. …
- sed. There are a couple of nice ways to do this with sed . …
- awk. awk has a built in variable NR that keeps track of file/stream row numbers.