From 40a910e6cfbcd7dbdcea58a69cdc999233450816 Mon Sep 17 00:00:00 2001 From: Ray Voice <33094591+Ray6464@users.noreply.github.com> Date: Tue, 13 Oct 2020 02:53:52 +0500 Subject: [PATCH] sed: add 11q example (#4399) --- pages/common/sed.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pages/common/sed.md b/pages/common/sed.md index 2b7a7e31a..6f1b4ad8e 100644 --- a/pages/common/sed.md +++ b/pages/common/sed.md @@ -22,9 +22,9 @@ `sed '/{{line_pattern}}/d' {{filename}}` -- Print only text between n-th line till the next empty line: +- Print the first 11 lines of a file: -`sed -n '{{n}},/^$/p' {{filename}}` +`sed 11q {{filename}}` - Apply multiple find-replace expressions to a file: @@ -33,7 +33,3 @@ - Replace separator / by any other character not used in the find or replace patterns, e.g., #: `sed 's#{{find}}#{{replace}}#' {{filename}}` - -- Print only the n-th line of a file: - -`sed '{{n}}q;d' {{filename}}`