1

Often times I want to kill process that I believe has changed its command name (I think through setproctitle() or something similar).

Apparent pkill, pgrep, and friends do not read the new command names (ie ruby process renames its command, pkill still sees it as ruby and not delayed_job).

However ps and h?top do.

Is my only resort greping/awking ps to kill these kinds of processes or am I missing something?

Adam Gent
  • 260
  • 1
  • 7

1 Answers1

1

Try using ps -f, pgrep -f and pkill -f.

From the respective man pages:

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.