Linux Command to Immediately Kill Any Process Matching a Specific Name

Wrote up a quick command to send “kill -9” to any processes matching a specific word. This is useful in cases where “pkill -f” doesn’t quite immediately kill a process that I want dead.

ps -ea | grep java | awk {'print $1'} | xargs kill -9

Leave a comment