浏览代码

grep: add flags for lines before and after the match (#1020)

Rahul Kavale 8 年之前
父节点
当前提交
bf955d43e6
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      pages/common/grep.md

+ 2 - 2
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: