
Muitas vezes eu quero matar um processo que acredito ter mudado seu nome de comando (Eu penso setproctitle()
ou algo semelhante).
Aparentemente pkill
, pgrep
e amigos não leem os novos nomes de comando (ou seja, o processo Ruby renomeia seu comando, pkill ainda o vê como ruby
e não delayed_job
).
No entanto ps
e h?top
faça.
Meu único resort está greping/awking ps
para eliminar esses tipos de processos ou estou faltando alguma coisa?
Responder1
Tente usar ps -f
, pgrep -f
e pkill -f
.
Nas respectivas páginas de manual:
ps -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.
-
pgrep/pkill -f, --full
The pattern is normally only matched against the process name.
When -f is set, the full command line is used.