sed 's/<match-pattern>/<replace-pattern>/g' <some-filename.txt>
- to replace infile
sed -i 's/<....
- /g (global)
- /p (print)
- /I (ignore case)
- /w some-filename (write to some-filename)
- /../../ Delimiter
- match-pattern Regular Expression Pattern Search Pattern
- replacement-pattern Replacement string
- y/source/dest/
- Transliterate the characters in the pattern space which appear in source to the corresponding character in dest.
- one to one mapping
- Example :
'y/0123/_abc/'
replaces the stream as- 0 -> _
- 1 -> a
- 2 -> b
- 3 -> c
/ is not the only delimiter. Use # or _ or anything convinient
sed -e 'first-expression' -e 'second-expression' ...
cat some-file-input | sed 'some-expression'