You can use Linux sed or awk or head and tail command to extract lines between two line numbers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
## create a long file with 200 lines > myfile; i=1; while [ $i -le 200 ]; \ do echo -n "$i " >> myfile; ((i++)); done echo >> myfile ## extract lines between 120 and 140 line number ## using head and tail head -140 myfile | tail -21 ## using awk awk 'NR>=120&&NR<=140' myfile ## using sed sed -n '120,140p' myfile rm myfile |