home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: 9.2 Alphabetical Summary of Ex Commands Chapter 10 Next: 10.2 Conceptual Overview
 

10. The Sed Editor

This section presents the following topics:

  • Command-line syntax

  • Conceptual overview of sed

  • Syntax of sed commands

  • Group summary of sed commands

  • Alphabetical summary of sed commands

For more information, see the Nutshell Handbook sed & awk .

10.1 Command-line Syntax

The syntax for invoking sed has two forms:

sed [ options ] ' command ' file(s)

sed [ options ] -f scriptfile file(s)

The first form allows you to specify an editing command on the command line, surrounded by single quotes. The second form allows you to specify a scriptfile , a file containing sed commands. If no files are specified, sed reads from standard input.

The following options are recognized:

-n

Suppress the default output; sed displays only those lines specified with the p command, or with the p flag of the s command.

-e cmd

Next argument is an editing command; not needed unless specifying two or more editing commands.

-f file

Next argument is a file containing editing commands.


Previous: 9.2 Alphabetical Summary of Ex Commands UNIX in a Nutshell: System V Edition Next: 10.2 Conceptual Overview
9.2 Alphabetical Summary of Ex Commands Book Index 10.2 Conceptual Overview

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System