SED
Delimiters
- Common delimiters:
/,#,|,@
| Delimiter | Notes |
|---|---|
/ |
default, most common |
# |
great for paths/URLs |
@ |
readable in scripts |
\| |
good for nested slashes |
: |
safe everywhere |
~ |
nice visually |
% |
rarely used but valid |
! |
valid |
, |
valid |
Flags
-i= edit in file (instead of printing content to stdout)
Replacement Flags
/g= global (all occurrences in line, not just first)//= replace with nothing
Replacement Syntax
File Replacement
String Replacement Example
output: "bye1x bye2x"
Regex
File Extension Replacement
output: "filename"
String Strip Example
output: "hello world"