Kill all processes with specified name

From vpsget wiki
Revision as of 12:42, 4 December 2013 by Ndi (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

If you need to kill all processes with specified process name/pattern you can use the pkill command. First of all you can get the process list for specified pattern:

ps aux | grep <pattern>

For example to get all exim processes:

ps aux | grep exim

You will see the list of processes. No you can kill all of them using next command:

pkill -9 -f <pattern>

For example kill all exim processes:

pkill -9 -f exim

""