awk 'NR>=5 && NR<=10' file.txt

Category: Text Processing

awk 'NR>=5 && NR<=10' file.txt

Print lines 5 through 10

Prints lines 5 through 10 by checking awk's line counter (NR) against a range.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.