Bash one-liner: kill all processes with the same name

By | February 11, 2021

A simple one liner to kill all the processes having the same name or token in the name (myprocess):

kill -9 $(ps aux | grep myprocess | awk ‘{print $2}’)

This is a very effective way of cleaning up stuck processes that were spawned by some gone wrong software.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.