From bf955d43e6f4c4076090a4f43c666b9b8fc5e31d Mon Sep 17 00:00:00 2001 From: Rahul Kavale Date: Mon, 29 Aug 2016 05:13:14 +0530 Subject: [PATCH] grep: add flags for lines before and after the match (#1020) --- pages/common/grep.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/common/grep.md b/pages/common/grep.md index ea933a7c82..9a4ab3db64 100644 --- a/pages/common/grep.md +++ b/pages/common/grep.md @@ -19,9 +19,9 @@ `grep -E {{^regex$}} {{path/to/file}}` -- Print 3 lines of context around each match: +- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match: -`grep -C 3 {{search_string}} {{path/to/file}}` +`grep -{{C|B|A}} 3 {{search_string}} {{path/to/file}}` - Print the count of matches instead of the matching text: