linux杀掉指定进程 #!/bin/bash read -p "请输入要kill的进程名:" processName pid=`ps -ef | grep $processName | grep -v grep | awk '{print $2}'` echo "$var进程的PID是:$pid" for i in $pid do kill -9 $i echo "$processName进程pid:[ $i ]已经kill掉" done