#!/bin/sh  
TOM_HOME=$1 
ps -ef|grep $TOM_HOME|grep -v grep|grep -v kill  
if [ $? -eq 0 ];then  
kill -9 `ps -ef|grep $TOM_HOME|grep -v grep|grep -v kill|awk '{print $2}'`  
else  
echo $TOM_HOME' No Found Process'  
fi 

  使用时,保存成文件,比如killps.sh 。然后killps 进程名即可

#!/bin/sh TOM_HOME=$1 ps -ef|grep $TOM_HOME|grep -v grep|grep -v kill if [ $? -eq 0 ];then kill -9 `ps -ef|grep $TOM_HOME|grep -v grep|grep -v kill|awk '{print $2}'` else echo $TOM_HOME' No Found Process' fi

相关文章:

  • 2021-08-17
  • 2022-01-20
  • 2022-02-01
  • 2021-05-18
  • 2021-06-09
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
猜你喜欢
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2022-02-12
  • 2021-08-15
  • 2021-12-16
相关资源
相似解决方案