程序调试阶段可能会需要批量kill进程的情况,
1.如果所kill进程名称相同时
可用
killall proc_name
2. 可利用进程号批量kill
ps -elf | grep response_sync_serv
217:0 S d5000 8333 1 1 78 0 - 20290 run_in 12:17 pts/3 00:00:00 ./response_sync_serv realtime public test1_ser1_1 50001
218:0 S d5000 8334 1 1 78 0 - 20290 run_in 12:17 pts/3 00:00:00 ./response_sync_serv realtime public test1_ser2_1 53001
219:0 S d5000 8336 1 1 78 0 - 20290 run_in 12:17 pts/3 00:00:00 ./response_sync_serv realtime public test1_ser1_2 50002
220:0 S d5000 8338 1 1 78 0 - 20290 run_in 12:17 pts/3 00:00:00 ./response_sync_serv realtime data_srv test1_ser3_1 56001
221:0 S d5000 8339 1 0 78 0 - 20290 run_in 12:17 pts/3 00:00:00 ./response_sync_serv realtime scada test1_ser4_1 59001
ps -elf | grep response_sync_serv | awk '{print $4}'
8333
8334
8336
8338
8339
ps -elf | grep response_sync_serv | awk '{print $4}' | xargs kill -9