Files
2024-02-19 00:21:39 -05:00

66 lines
833 B
Plaintext

Command: sed - stream editor
Syntax: sed [-egn] [-f script_file] [edit_script] [file]
Flags: -e Accept multiple commands commands on the commands line
-f The following argument contains the edit script
-g Set the global flag on all substitute commands
-n Only output selected lines
Examples: sed -f script <file # Run a sed script on file
sed '/pig/s//hog/g' <file # Replace pig by hog in the file
Sed is a stream editor. It takes an edit script either from its
argument or a file, and performs an edit session on a named file or
stdin, producing output on stdout.