From e35139ebf397f714d1e21ed3b3a26e75552ce3cd Mon Sep 17 00:00:00 2001 From: jaywcjlove Date: Thu, 3 Nov 2022 03:04:40 +0000 Subject: [PATCH] doc: update `sed.md`. e87ce59a885881b9b35214cb0c5dde1abc35bd4d --- docs/sed.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sed.html b/docs/sed.html index 256d0ece..08e763af 100644 --- a/docs/sed.html +++ b/docs/sed.html @@ -151,7 +151,7 @@ -
CommandExampleDescription
psed -n '1,4 p' input.txtPrint lines 1-4
psed -n -e '1,4 p' -e '6,7 p' input.txtPrint lines 1-4 and 6-7
dsed '1,4 d' input.txtPrint lines except 1-4
wsed -n '1,4 w output.txt' input.txtWrite pattern space to file
ased '2 a new-line' input.txtAppend line after
ised '2 i new-line' input.txtInsert line before
+
命令示例描述
psed -n '1,4 p' input.txt打印第 1-4 行
psed -n -e '1,4 p' -e '6,7 p' input.txt打印第 1-4 行和第 6-7 行
dsed '1,4 d' input.txt打印除 1-4 之外的行
wsed -n '1,4 w output.txt' input.txt将模式空间写入文件
ased '2 a new-line' input.txt在后面追加一行
ised '2 i new-line' input.txt在前面插入行

空间命令

@@ -187,7 +187,7 @@ -
CommandDescription
n打印模式空间,空模式空间,读取下一行
x用保持空间交换模式空间
h复制模式空间以保持空间
H追加模式空间以保持空间
g将保持空间复制到模式空间
G将保持空间附加到模式空间
+
命令描述
n打印模式空间,空模式空间,读取下一行
x用保持空间交换模式空间
h复制模式空间以保持空间
H追加模式空间以保持空间
g将保持空间复制到模式空间
G将保持空间附加到模式空间

Flags

$ sed 's/old/new/[flags]' [input-file]