linux查找某进程id并杀掉


痞子三分冷 提交于 2020-02-14 18:04:23

 


#!/bin/sh
tomcat_id=$(ps -ef | grep tomcat | grep -v "grep" | awk '{print $2}') for tomcatid in $tomcat_id do kill -9 ${tomcatid} echo "killed tomcat_id $tomcatid" done sh /data/4a/tomcat/bin/startup.sh echo "restart tomcat..."

 

 

#"--------4a--------"tomcat_id=$(ps -ef | grep tomcat | grep -v "grep" | awk '{print $2}')for tomcatid in $tomcat_iddo    kill -9 ${tomcatid}        echo "killed tomcat_id $tomcatid"   donesh /data/4a/tomcat/bin/startup.shecho "restart tomcat..." 

工具导航Map