May*_*hux 76 command-line process
为了搜索过程中,你可以使用ps同grep。
例如搜索firefox
ps aux | grep firefox
Run Code Online (Sandbox Code Playgroud)
如何在不使用的情况下获得相同的答案grep?
May*_*hux 32
ps -fC process-name
Run Code Online (Sandbox Code Playgroud)
例子:
ps -fC firefox
Run Code Online (Sandbox Code Playgroud)
从 man ps
-C cmdlist Select by command name.
This selects the processes whose executable name is
given in cmdlist.
-f Do full-format listing. This option can be combined
with many other UNIX-style options to add additional
columns. It also causes the command arguments to be
printed. When used with -L, the NLWP (number of
threads) and LWP (thread ID) columns will be added. See
the c option, the format keyword args, and the format
keyword comm.
Run Code Online (Sandbox Code Playgroud)
小智 5
一个很酷的技巧
$ps -ejH
Run Code Online (Sandbox Code Playgroud)
您将获得所有带有名称的进程
exmple:
1747 568 568 ? 00:00:00 colord
1833 1832 1832 ? 00:00:00 gnome-keyring-d
2263 568 568 ? 00:00:00 udisksd
2311 2311 2311 ? 00:00:00 cupsd
2315 2315 2311 ? 00:00:00 dbus
Run Code Online (Sandbox Code Playgroud)
重定向或将输出复制到文件中,然后打开nano,按Ctrl+W
即可搜索所需的名称。