Kill tomcat sh in ubuntu 10.04
first run try to run this script :
ps aux | grep -i tomcat | grep -v grep | cut -d ' ' -f (1 2 3 4 5 6.....)
in my pc ,I run [
ps aux | grep -i tomcat | grep -v grep | cut -d ' ' -f 7]
it will show this result : 6817 7239
this result is showing your current tomcat process'id ;
my kill-tomcat.sh content:
ps aux|grep tomcat echo "**********start***********" for p in $(ps aux | grep -i tomcat | grep -v grep | cut -d ' ' -f 7) do kill -9 $p done echo "************end************" ps aux|grep tomcat