0

我的进程名称是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

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

4

1 回答 1

1

这似乎在man pgrep

笔记

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

于 2020-05-18T20:55:07.450 回答