Contents:
Command-line Syntax
Conceptual Overview
Syntax of Sed Commands
Group Summary of Sed Commands
Alphabetical Summary of Sed Commands
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.
The syntax for invoking sed has two forms:
sed [
options] 'command'file(s)sed [
options] -fscriptfile 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:
Suppress the default output; sed displays only those lines specified with the p command, or with the p flag of the s command.
cmdNext argument is an editing command; not needed unless specifying two or more editing commands.
fileNext argument is a file containing editing commands.