#Bash one liner: Search and kill a #Java process based on a path token

By | January 15, 2020

The bash one liner of the day is to find and kill a Java process using one liner.

In my case I have a Jboss application server domain that is stuck. By using jps command that displays only the running Java processes is a no brainer to kill the process by using a token that is part of the path where the domain configuration is under some …/my_test_domain/… directory:

# kill -9 $(jps -v | grep /my_test_domain/ | awk ‘{print $1}’)

Leave a Reply

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