Remove lines 5 through 10.
Section: sed Line Deletion and Printing
Delete a line range
bash
bash
sed '5,10d' file.txtExplanation
Ranges are useful for removing generated headers or blocks quickly.
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