Chapter 5. The GNU sed stream editor

Table of Contents
5.1. Introduction
5.1.1. What is sed?
5.1.2. sed commands
5.2. Interactive editing
5.2.1. Printing lines containing a pattern
5.2.2. Deleting lines of input containing a pattern
5.2.3. Ranges of lines
5.2.4. Find and replace with sed
5.3. Non-interactive editing
5.3.1. Reading sed commands from a file
5.3.2. Writing output files
5.4. Summary
5.5. Exercises

At the end of this chapter you will know about the following topics:

  • What is sed?

  • Interactive use of sed

  • Regular expressions and stream editing

  • Using sed commands in scripts

NoteThis is an introduction

These explanations are far from complete and certainly not meant to be used as the definite user manual for sed. This chapter is only included in order to show some more interesting topics in the next chapters, and because every power user should have a basic knowledge of things that can be done with this editor.

For detailed information, refer to the sed info and man pages.