kill tomcat or some you want to kill in one time
kill tomcat or some you want to kill in one time
kill tomcat or some you want to kill in one time
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]
Java代码
it will show this result :
6817
7239
this result is showing your current tomcat process'id ;
my kill-tomcat.sh content:
Java代码
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
评论暂时关闭