Chapter 23. Who Sed That?

If you haven’t used sed before, you’re missing a powerful jewel, a fast and useful tool. First, a confession. Before writing the column this chapter is based on, I had never used it. I wasn’t even sure what it did.

So What Is Sed?

Sed is the GNU Stream Editor. Remember streams, the data in motion we talked about in Chapter 5, “Everything’s a File?” One way to look at sed is to think of the data to be edited being passed by the editor, instead of the other way around.

And that only happens one time, it goes by sed from top to bottom, start to finish. Sed acts on the data once, as it passes by.

Let’s use the following old paragraph of text for our examples throughout the column. Here it is as we found it in a dusty old archive. ...

Get CLI for Noobies: A Primer on the Linux Command Line now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.