Chapter 10. The sed Editor

The sed “stream editor” is one of the most prominent text-processing tools on Unix and Linux. It is most often used for performing simple substitutions on data streams going through pipelines, but sed scripts can be written to do much more.

This chapter presents the following topics:

  • Conceptual overview of sed

  • Command-line syntax

  • Syntax of sed commands

  • Group summary of sed commands

  • Alphabetical summary of sed commands

The version of sed provided with Linux systems is the GNU version written by the Free Software Foundation; its home page is http://www.gnu.org/software/sed/sed.html. For more information on sed, see Dale Dougherty and Arnold Robbins’s sed & awk (O’Reilly).

Get Linux in a Nutshell, 6th Edition 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.