GNU sed Options
GNU sed accepts a number of additional command-line options, as well as long-option equivalents for the standard options. The GNU sed options are:
-ecmd,--expressioncmdUse cmd as editing commands.
-ffile,--filefileObtain editing commands from file.
-
--help Print a usage message and exit.
-i[suffix],--in-place[=suffix]Edit files in place, overwriting the original file. If optional suffix is supplied, use it for renaming the original file as a backup file. See the GNU sed online Info documentation for the details.
-llen,--line-lengthlenSet the line length for the l command to len characters.
-n,--quiet,--silentSuppress the default output; sed displays only those lines specified with the
pcommand or with thepflag of thescommand.-
--posix Disable all GNU extensions. Setting POSIXLY_CORRECT in the environment merely disables those extensions that are incompatible with the POSIX standard.
-r,--regex-extendedUse Extended Regular Expressions instead of Basic Regular Expressions. See Chapter 7 for more information.
-s,--separateInstead of considering the input to be one long stream consisting of the concatenation of all the input files, treat each file separately. Line numbers start over with each file; the address
$refers to the last line of each file; files read by theRcommand are rewound; and range addresses (/x/,/y/) may not cross file boundaries.-u,--unbufferedBuffer input and output as little as possible. Useful for editing the output of
tail -fwhen you don’t ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access