根据进程名强行删除进程

#!/bin/bash

echo "pid_kill进程名:$1"
PROC_NAME=$1
ProcNumber=`ps -ef |grep -w $PROC_NAME|grep -v grep|wc -l`
if [ $ProcNumber -le 0 ];then
   echo "$PROC_NAME is not run"
else
   echo "$PROC_NAME is  running.."
   echo "ps -ef | grep $PROC_NAME |grep -v ‘grep‘| awk ‘{print $2}‘ |while read pid; do kill -9 $pid; done"
   ps -ef | grep $PROC_NAME |grep -v grep| awk {print $2} |while read pid; do kill -9 $pid; done
fi

 

根据进程名强行删除进程

上一篇:基于Pytorch训练Pointnet+Windows10


下一篇:windows下快速删除node_modules