Visualize sed commands with live output, diff highlighting, and step-by-step breakdown.
s/old/new/Replace first occurrence per line
s/old/new/gReplace all occurrences per line
s/old/new/2Replace 2nd occurrence per line
s/old/new/ICase-insensitive replace (GNU)
/pattern/dDelete lines matching pattern
/pattern/!dDelete lines NOT matching pattern (keep matches)
3dDelete line 3
2,5dDelete lines 2 through 5
/^$/dDelete empty lines
/start/,/end/dDelete from start pattern to end pattern
y/abc/xyz/Transliterate: a→x, b→y, c→z
3pPrint line 3 (use with -n)
/pattern/pPrint matching lines (use with -n)
2,4s/a/b/Substitute only on lines 2-4
/pat/s/a/b/Substitute only on lines matching /pat/
&Backreference to whole match in replacement
\1 \2Backreference to capture groups
\bWord boundary (extended regex)
|Alternative delimiter: s|old|new|
\u \lUppercase/lowercase next char (GNU)
\U \LUppercase/lowercase until \E (GNU)