Skip to content

Instantly share code, notes, and snippets.

@baybatu baybatu/tomcat_killer.sh
Last active Dec 15, 2015

Embed
What would you like to do?
Kill tomcat from terminal easily
#!/bin/bash
ps -A | grep tomcat | awk '$4 !~ /grep/ {print $1}' | xargs kill -9

You have to make the script executable via 'chmod' before execution. If the script file name is 'tomcat_killer.sh'

$ sudo chmod +x tomcat_killer.sh

then to create shortcut, rename the file to 'k' and copy to /usr/bin/ (or one of the another path in PATH variable)

$ sudo mv tomcat_killer.sh k
$ sudo cp k /usr/bin

now k kills Tomcat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.