【发布时间】:2026-02-23 22:30:02
【问题描述】:
当我尝试使用此命令在 grep 手册中搜索颜色选项时,怎么会发生
man grep | grep "color"
我没有得到任何结果,但是当我运行时
man grep
man 输出这个 [EDITED]
--colour=[when, --color=[when]]
Mark up the matching text with the expression stored in GREP_COLOR environment variable. The possible values of when can be `never', `always' or `auto'.
【问题讨论】:
-
“印刷手册”是指纸上的吗?那么那个印刷手册可能不适合
grep的安装版本。 -
man grep | grep color非常适合我。 -
这里的常规 man 命令在连接到管道时不会发送转义序列。也许你的 man 命令超载了,请确保你使用带有
command man grep | grep 'color'的实际命令。 -
@sth 我的意思是 man 输出的内容,现在在问题中进行了编辑。