Skip to content

Instantly share code, notes, and snippets.

@wedens
Created November 9, 2012 04:58
Show Gist options
  • Save wedens/4043778 to your computer and use it in GitHub Desktop.
Save wedens/4043778 to your computer and use it in GitHub Desktop.
kill all tomcat instances
killtom() {
pid=$(ps aux | grep apache-tomcat | grep 'bin/java' | grep -v grep | awk '{print $2}')
if [ -z "$pid" ]
then
echo "Tomcat is not running!"
else
echo "Killing Tomcat PID: $pid"
kill -9 $pid
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment