Linux 通过程序名获取进程ID并Kill

#!/bin/bash
pids=$(ps -ef | grep XXX| awk '{print $2}')
for pid in $pids
do
 echo  $pid
 kill -9  $pid
done
posted @ 2019-03-04 20:50  youngliu91  阅读(3827)  评论(0编辑  收藏  举报