I have file with 10 lines where content of first line in 1, second line 2, third line is 4 …… and tenth line is 10.
Here I will show some operations related to read read in lines based their line numbers.
Print from line number 5 to end of file:
$ awk 'NR>=5' inputFile
or
$ sed '1,4d' inputFile
Print from line number 4 to 9 or print lines between linen number 3 and 10:
$ awk 'NR>=4 && NR<=9' inputFile
or
$ sed -n '4,9p' inputFile
Print all even lines numbers:
$ awk '{if(NR%2 == 0) {print $1}}' inputFile
Print all odd lines numbers:
$ awk '{if(NR%2 != 0) {print $1}}' inputFile