O'Reilly logo

CLI for Noobies: A Primer on the Linux Command Line by Joe Barr

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required