1.查需要杀死的进程
ps -ef | grep yum
2.去除掉里面的grep
ps -ef | grep yum | grep -v grep
3.打印kill命令
ps -ef | grep yum | grep -v grep | awk '{print "kill "$2}'
4.执行kill命令
ps -ef | grep yum | grep -v grep | awk '{print "kill "$2}' | sh
删除完成
ps -ef | grep yum
ps -ef | grep yum | grep -v grep
ps -ef | grep yum | grep -v grep | awk '{print "kill "$2}'
ps -ef | grep yum | grep -v grep | awk '{print "kill "$2}' | sh
删除完成