Site icon Voina Blog (a tech warrior's blog)

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

Advertisements

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}’)

Exit mobile version