Linux Basics for Hackers — Chapter 2: Text ManipulationText Manipulation · Lesson 2 of 2 · “Search-and-replace from the command line: meet sed
Story page · ~3 min lesson

When a GUI editor is the wrong tool

Opening a text editor to change one word in a configuration file is fine when you have one file. It is misery when you have fifty. The Linux command sed exists for exactly this: search for a word or text pattern, then perform an action on every match — all without opening the file in an editor.

The source describes sed as a tool that lets you look for occurrences of a word or pattern and then act on them. Its name is short for stream editor, which captures the idea: sed edits a stream of text as it flows past, line by line.

sed is non-interactive search-and-replace for files and streams — write the rule once, apply it everywhere.