如何在腳本中殺掉進程
大佬那里找來的命令:http://www.rzrgm.cn/linjiqin/p/7877721.html
作為備份,方便查找,就直接抄過來了,不過殺程序時要小心,不要誤傷別的進程。
查找tomcat進程
ps -ef | grep tomcat | grep -v grep | awk '{print $2}'
查找tomcat進程并殺死
ps -ef | grep tomcat | grep -v grep | awk '{print $2}' | xargs kill -9
或者
kill -9 `ps -ef | grep tomcat| grep -v grep |awk '{print $2}'`
浙公網安備 33010602011771號