1、先查询所有进程
ps -ef|grep python
2、用awk打印第2列,即进程ID
awk '{print $2}'
3、最后批量kill
xargs kill -9
最后的命令就是:ps -ef|grep python | awk '{print $2}' |xargs kill -9