Editing Streams with sed

Learn how to edit streams and achieve the find and replace functionality using the sed command.

The sed command

If we need to modify text in a pipeline or a file, sed is our best friend. Its name is short for “stream editor,” and it’s convenient. While we can do many things with sed, the most common use is to replace some text with other text, similar to how we use the find and replace feature in our text editor.

Like other tools, sed can read its input from a file or standard input. Let’s try it out. Print out Hello World and use sed to replace Hello ...