【发布时间】:2020-07-10 18:14:55
【问题描述】:
假设我在终端中运行以下命令:
pgrep Google Chrome
它会产生以下所有 PID 的输出:
110
311
142
如果不计算自己产生的类似内容,我如何才能准确显示列出了多少进程:
110
311
142
There are currently 3 processes running under the application 'Google Chrome'
【问题讨论】:
-
pgrep 'Google Chrome' | wc -l -
顶部 | grep 谷歌浏览器 | uniq 类似这样的工作?