From 004523119f3dae4b9c6c5ac467302d1270a4eb3e Mon Sep 17 00:00:00 2001 From: logicwang <1758555877@qq.com> Date: Thu, 13 Jan 2022 23:44:45 +0800 Subject: [PATCH] Update grep.md (#327) --- command/grep.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/command/grep.md b/command/grep.md index e6a2957c54..860c1c9e0b 100644 --- a/command/grep.md +++ b/command/grep.md @@ -119,6 +119,12 @@ line. grep -c "text" file_name ``` +搜索命令行历史记录中 输入过 `git` 命令的记录: + +```shell +history | grep git +``` + 输出包含匹配字符串的行数 **-n** 选项: ```shell