Alternative line-range extraction using NR.
Section: Line Selection and Context
Print line range with awk
bash
bash
awk 'NR>=100 && NR<=120' file.txtExplanation
Awk's `NR` variable tracks the current line number.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Line Selection and Context