如何在ps中查找和打印命令的参数?

cha*_*non 6 shell ps process-management

sudo ps o gpid,comm报告类似3029 bash但命令有参数--arbitrary -other -searchword有没有办法显示这些参数?

hee*_*ayl 6

您可以简单地使用with选项,而不是格式化输出ps然后使用:greppgrep-a

pgrep -a bash
Run Code Online (Sandbox Code Playgroud)

这将显示命令名称 ( bash) 及其参数(如果有)。

来自man pgrep

-a, --list-full
              List the full command line as well as the process ID.
Run Code Online (Sandbox Code Playgroud)