What problem does it solve?
sed solves the problem of extracting and transforming specific parts of large text files quickly, without loading the whole file or requiring interactive editing.
Core Features & Use Cases
- Line-range and pattern extraction: Pull exact line segments or capture content between start/end markers for context extraction.
- Deterministic find-and-replace: Perform non-interactive substitutions for cleanup, normalization, or targeted edits across files.
- Stream-safe text processing: Handle log or dump snippets in pipelines while minimizing terminal flooding using
sed -n where appropriate.
Use cases: extracting a block from a build log for debugging, normalizing text before analysis, or preparing a snippet for a report by selecting only the relevant lines.
Quick Start
Use sed to extract lines 80 to 95 from a large file named app.log: run the command sed -n '80,95p' app.log.