How to get 'nth' line of a text file in linux |
Below are the two better ways to print nth line of text files in linux.
1. Use the combination of head and tail command
one of the easiest way of printing nth line of a text file is by using the combination of head and tail command.Below is an exapmle of how to use it for displaying the 9th line of a file named sample.txt