使用awk批量杀进程的命令:
ps -ef | grep firefox | grep -v grep | awk '{print "kill -9 "$2}'|sh
说明:
ps -ef | grep firefox | grep -v grep
ps -ef | grep firefox | grep -v grep | awk '{print "kill -9 "$2}'
ps -ef | grep firefox | grep -v grep | awk '{print "kill -9 "$2}' | sh
使用cut批量杀进程的命令
ps -ef | grep firefox | grep -v grep | cut -c 9-15 | xargs kill -9
说明:
ps -ef | grep firefox | grep -v grep
ps -ef | grep firefox | grep -v grep | cut -c 9-15
ps -ef | grep firefox | grep -v grep | cut -c 9-15 | xargs kill -9