Linux殺死指定名字線程

#!/bin/sh


result=`ps -ef|grep 'python **updatelaw.py'|grep -v 'grep'|awk '{print $2}'`


if [ -z "$result" ]
then
echo "Not Python Spider,But Ant would continue!Blacklist-updatelaw"
else
ps -ef|grep '**python **updatelaw.py'|grep -v 'grep'|awk '{print $2}'|xargs kill -9
echo "Killed $result"
fi


殺死指定名字線程

ps -ef|grep '**XXXXXX**'|grep -v 'grep'|awk '{print $2}'|xargs kill -9
**少一個也不行
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章