【问题标题】:pgrep does not search for long (more than 15 chars) process namepgrep 不搜索长(超过 15 个字符)进程名称
【发布时间】:2020-05-18 19:51:01
【问题描述】:

我的进程名称是core-plugin-loader

core-plugin-loader --file=/usr/lib/blah.so &

pi@kyb-pi4 /usr> pgrep core-plugin-loader
pi@kyb-pi4 /usr> pgrep core-plugin-loa
13892
pi@kyb-pi4 /usr> pgrep -a core-plugin-loa
13892 core-plugin-loader --file=/usr/lib/blah.so
pi@kyb-pi4 /usr> pgrep -a core-plugin-loader

版本:

pgrep from procps-ng 3.3.15

> head -1 /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"

看起来很奇怪。如何为pgrep 解决此问题?

Here 是关于线程名称的 Q。但我要一个进程名称。

【问题讨论】:

    标签: linux procps


    【解决方案1】:

    这似乎在man pgrep

    注意事项

    用于匹配的进程名限制为 15 个字符 出现在 /proc/pid/stat 的输出中。使用 -f 选项 匹配完整的命令行, /proc/pid/cmdline。

    【讨论】:

      猜你喜欢
      • 2011-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多