From 7d23961ac3e593f2742e9f773688eed46f82ca48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Fri, 16 Nov 2018 15:11:22 +0100 Subject: [PATCH] sed: Add example to delete lines (#2596) --- pages/common/sed.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/common/sed.md b/pages/common/sed.md index d92ba4d887..4138cfd634 100644 --- a/pages/common/sed.md +++ b/pages/common/sed.md @@ -18,6 +18,10 @@ `sed '/{{line_pattern}}/s/{{find}}/{{replace}}/' {{filename}}` +- Delete lines matching the line pattern: + +`sed '/{{line_pattern}}/d' {{filename}}` + - Print only text between n-th line till the next empty line: `sed -n '{{line_number}},/^$/p' {{filename}}`