[英]pgrep does not search for long (more than 15 chars) process name
My process name is core-plugin-loader
我的进程名称是
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
Version:版本:
pgrep from procps-ng 3.3.15
> head -1 /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
Looks very strange.看起来很奇怪。 How to fix this for
pgrep
?如何为
pgrep
解决这个问题?
Here is Q about thread name. 这是关于线程名称的Q。 But I ask for a process name.
但我要求一个进程名称。
This seems to be in man pgrep
:这似乎在
man pgrep
:
NOTES
笔记
The process name used for matching is limited to the 15 characters present in the output of /proc/pid/stat.
用于匹配的进程名称限制为 /proc/pid/stat 的 output 中存在的 15 个字符。 Use the -f option to match against the complete command line, /proc/pid/cmdline.
使用 -f 选项匹配完整的命令行 /proc/pid/cmdline。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.