我正在研究多用户Ubuntu服务器,需要运行多处理python脚本.有时我需要杀死其中一些进程.例如,
$ ps -eo pid,comm,cmd,start,etime | grep .py
3457 python python process_to_kill.py - 20:57:28 01:44:09
3458 python python process_to_kill.py - 20:57:28 01:44:09
3459 python python process_to_kill.py - 20:57:28 01:44:09
3460 python python process_to_kill.py - 20:57:28 01:44:09
3461 python python process_to_kill.py - 20:57:28 01:44:09
3462 python python process_to_kill.py - 20:57:28 01:44:09
3463 python python process_to_kill.py - 20:57:28 01:44:09
3464 python python process_to_kill.py - 20:57:28 01:44:09
13465 python python process_not_to_kill.py - 08:57:28 13:44:09
13466 python python process_not_to_kill.py - 08:57:28 13:44:09
Run Code Online (Sandbox Code Playgroud)
进程3457-3464将被杀死.到目前为止,我只能这样做
$ …Run Code Online (Sandbox Code Playgroud)