Show lines 5 through 10.
Section: sed Line Deletion and Printing
Print a line range only
bash
bash
sed -n '5,10p' file.txtExplanation
A compact way to inspect a specific segment of a file.
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 sed Line Deletion and Printing