How to kill all processes with a given partial name?

Łukasz Lew picture Łukasz Lew · Jan 24, 2012 · Viewed 464.5k times · Source

I want to kill all processes that I get by:

ps aux | grep my_pattern

How to do it?

This does not work:

pkill my_pattern

Answer

Dor Shemer picture Dor Shemer · Jan 24, 2012

Use pkill -f, which matches the pattern for any part of the command line

pkill -f my_pattern