Substitute matching text in a stream.
Section: sed awk and Structured Text Workflows
Replace text with sed
bash
bash
sed 's/localhost/db.internal/g' config.tplExplanation
Useful for one-off substitutions in streams or pipelines.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing sed awk and Structured Text Workflows