Multithreading 如何快速杀死运行特定脚本的所有线程?
我在一台服务器上发现了一堆长时间运行的脚本(Multithreading 如何快速杀死运行特定脚本的所有线程?,multithreading,command-line,grep,ps,Multithreading,Command Line,Grep,Ps,我在一台服务器上发现了一堆长时间运行的脚本(script.php),我想把它们全部杀掉 ps aux | grep script.php user 6270 0.1 0.1 375580 50476 ? Ss Aug20 2:18 php /path/to/script.php user 6290 0.1 0.1 375580 50476 ? Ss 15:34 0:00 php /path/to/script.php user 7439 0.1
script.php
),我想把它们全部杀掉
ps aux | grep script.php
user 6270 0.1 0.1 375580 50476 ? Ss Aug20 2:18 php /path/to/script.php
user 6290 0.1 0.1 375580 50476 ? Ss 15:34 0:00 php /path/to/script.php
user 7439 0.1 0.1 375580 50476 ? Ss Aug18 2:05 php /path/to/script.php
user 8270 0.1 0.1 375580 50476 ? Ss Aug17 7:18 php /path/to/script.php
user 8548 0.1 0.1 375580 50476 ? Ss Aug15 0:15 php /path/to/script.php
user 8898 0.1 0.1 375580 50476 ? Ss Aug17 3:01 php /path/to/script.php
user 9875 0.1 0.1 375580 50476 ? Ss Aug18 2:18 php /path/to/script.php
我可以一次杀一个,就像这样:
kill 6270
但是我怎么能一次杀死所有的人呢?使用Linux:
pkill -f "php /path/to/script.php"
对于Linux:
pkill -f "php /path/to/script.php"
您可以使用pkill命令 看到这里了吗
必须类似于“pkill-nscript.php”您可以使用pkill命令 看到这里了吗 必须类似于“pkill-nscript.php”