Input/Output Processing

Command

Action

e

Execute commands.

n

Skip current line and go to the next line.

r

Read another file’s contents into the output stream.

R

Read one line from a file into the output.

w

Write input lines to another file.

W

Write first line in pattern space to another file.

q

Quit the sed script (no further output).

Q

Quit without printing the pattern space.

v

Require a specific version of GNU sed to run the script.

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.