sed — Stream Editor
Stream editing and text transformation with sed across 13 disciplines. Each discipline is a directory — add sub-pages as it grows without restructuring. All commands copy-paste-runnable on Arch Linux.
Disciplines
| Discipline | Description | Partials |
|---|---|---|
Pattern replacement, global/nth occurrence, backreferences, delimiters |
1 |
|
Line numbers, ranges, pattern ranges, step addressing, conditional substitution |
1 |
|
Capture groups, value extraction, IP parsing, YAML stripping, URL extraction |
1 |
|
Verify-before/change/verify-after, backups, diff preview, idempotent edits |
1 |
|
Append, insert, replace lines, join lines, read files into stream |
1 |
|
Bulk xref rename, config surgery, ANSI stripping, attribute transforms |
1 |
|
macOS vs GNU, greedy matching, BRE vs ERE, hold buffer, quoting traps |
1 |
|
Pattern space and hold space — h, H, g, G, x, reverse, swap, collect blocks |
1 |
|
Multi-line processing — N, P, D, join lines, paragraph mode, cross-line replace |
1 |
|
BRE vs ERE, character classes, anchors, backreferences, IP/MAC/date matching |
1 |
|
Flow control — labels, b, t, loops, :a;N;$!ba, script files, nth occurrence |
1 |
|
Real config surgery — sshd, pacman, systemd, INI, YAML, fstab, hosts, nginx, sysctl |
1 |
|
Multi-tool chains — grep+sed, find+xargs+sed, sed+awk, process substitution, tee |
1 |
See Also
-
awk — field processing (where sed operates on lines)
-
grep — pattern matching (sed’s read-only counterpart)
-
xargs — act on sed output
-
Regex Patterns — cross-tool regex reference