Skip to content

Instantly share code, notes, and snippets.

Last active December 15, 2015 05:27
What would you like to do?
Kill tomcat from terminal easily
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 ''

$ sudo chmod +x

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 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