killall -9 my_executable
But what if you don't want to kill processes based on an executable name, but rather on some argument name, or something else? That is, all processes that match some string?
You can. Here is the trick:
kill -9 $(ps aux | grep -v grep | grep my_process | awk '{print $2}')
(originally from here)
No comments:
Post a Comment