正在运行service --status-all | grep "firestarter"
在 Ubuntu 中显示 service --status-all
的完整输出文本“firestarter”以红色突出显示。如何让 grep 只显示包含匹配文本的行,并隐藏其他所有内容?
最佳答案
也许 service --status-all
写入 stderr,而不是 stdout?然后就可以使用
service --status-all 2>&1 | grep firestarter
关于linux - 抑制 Grep 中的非匹配行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7622845/