15 The sed Editor

The sed (stream editor) utility is a batch (noninteractive) editor. It transforms an input stream that can come from a file or standard input. It is frequently used as a filter in a pipe. Because it makes only one pass through its input, sed is more efficient than an interactive editor such as ed.

Syntax

A sed command line has the following syntax:

sed [-n] program [file-list]sed [-n] -f program-file [file-list]

The sed utility takes its input from files you specify on the command line or from standard input. Unless you direct output from sed elsewhere, it goes to standard output. ...

Get A Practical Guide to UNIX for Mac OS X Users 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.