Grep' - 多彩'参数不起作用

时间:2015-07-15 04:52:16

标签: bash shell command-line grep redhat

我想知道使用 - 多彩参数在grep中使用多种颜色突出显示的正确语法,但它说 - 多彩是未知选项。< / p>

请参阅下面的命令:

$ grep --colorful color color.txt
grep: unknown option -- colorful
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.

谢谢大家。

1 个答案:

答案 0 :(得分:4)

该选项名为--color--colour。不是--colorful

来自Unix Man pages : grep()

--colour[=WHEN], --color[=WHEN]
      Surround  the matching string with the marker find in GREP_COLOR
      environment variable. WHEN may be 'never', 'always', or 'auto