Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.