The sed
command is a non-interactive stream editor that allows you to modify the content of the standard input or file. It performs an operation on each line in a pipeline. The syntax will be:
sed [OPTIONS]... {script} [input-file …]
By default, the output is displayed on stdout
, but can be redirected to a file if specified.
The input-file
are the files on which sed
needs to be run. If no files are specified, it reads from stdin
.
The script
can be a command or a file with multiple commands to pass to sed
, and OPTIONS
to sed
are described in the following table: