From 69434ed5e8e4a7895c28eb656f83e9a1368989b0 Mon Sep 17 00:00:00 2001 From: Abreto Fu Date: Sat, 14 May 2022 02:26:00 +0800 Subject: [PATCH] Add an example for grep with color output (#8087) --- 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 b30471d873..91c241099f 100644 --- a/pages/common/grep.md +++ b/pages/common/grep.md @@ -23,9 +23,9 @@ `grep --{{context|before-context|after-context}}={{3}} "{{search_pattern}}" {{path/to/file}}` -- Print file name and line number for each match: +- Print file name and line number for each match with color output: -`grep --with-filename --line-number "{{search_pattern}}" {{path/to/file}}` +`grep --with-filename --line-number --color=always "{{search_pattern}}" {{path/to/file}}` - Search for lines matching a pattern, printing only the matched text: