#!/bin/sh  
  
NAME=$1    #想要杀死的进程
echo $NAME  
ID=`ps -ef | grep "$NAME" | grep -v "grep" | awk '{print $2}'`  #注意此shell脚本的名称,避免自杀
echo $ID  
echo "---------------"  
for id in $ID  
do  
kill -9 $id  
echo "killed $id"  
done  

Logo

更多推荐