php – Pkill -f不适用于进程终止

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php – Pkill -f不适用于进程终止脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在运行此进程:
342 pts/2    T    0:00 sh -c sudo screen /usr/bin/python /usr/bin/BTdownloadcurses "http://zoink.IT/torrent/732A4A9B54B7E3A916C2835D936D985942F65A6D.torrent" --display_interval 20 --saveas "/srv/"
343 pts/2    T    0:00 sudo screen /usr/bin/python /usr/bin/btdownloadcurses http://zoink.it/torrent/732A4A9B54B7E3A916C2835D936D985942F65A6D.torrent --display_interval 20 --saveas /srv/
344 pts/2    T    0:00 screen /usr/bin/python /usr/bin/btdownloadcurses http://zoink.it/torrent/732A4A9B54B7E3A916C2835D936D985942F65A6D.torrent --display_interval 20 --saveas /srv/

我试着跑:

pkill -f http://zoink.it/torrent/732A4A9B54B7E3A916C2835D936D985942F65A6D.torrent

但这个过程仍在运行.
如何强制终止包含以下内容的进程:“http://zoink.it/torrent/732A4A9B54B7E3A916C2835D936D985942F65A6D.torrent”?

编辑如下:

ps ax | grep 'Momomoko.E01.140011.HDTV.H264.720p.mp4'

我想杀死包含上述字符串的所有进程.

我尝试运行上面的行,它返回三个结果:

342 pts/2    T    0:00 sh -c sudo screen /usr/bin/python /usr/bin/btdownloadcurses "http://zoink.it/torrent/732A4A9B54B7E3A916C2835D936D985942F65A6D.torrent" --display_interval 20 --saveas "/srv/Momomoko.E01.140011.HDTV.H264.720p.mp4"
  343 pts/2    T    0:00 sudo screen /usr/bin/python /usr/bin/btdownloadcurses http://zoink.it/torrent/732A4A9B54B7E3A916C2835D936D985942F65A6D.torrent --display_interval 20 --saveas /srv/Momomoko.E01.140011.HDTV.H264.720p.mp4
  344 pts/2    T    0:00 screen /usr/bin/python /usr/bin/btdownloadcurses http://zoink.it/torrent/732A4A9B54B7E3A916C2835D936D985942F65A6D.torrent --display_interval 20 --saveas /srv/Momomoko.E01.140011.HDTV.H264.720p.mp4

我该如何运行这一行:

ps ax | grep 'Momomoko.E01.140011.HDTV.H264.720p.mp4'

..with PHP,并杀死-9所有匹配的进程?

如您所见,该过程正在使用screen命令运行.
sh -c sudo screen /usr/bin/python
sudo screen /usr/bin/python
screen /usr/bin/python

因此,您无法使用您使用的命令终止进程.

要终止进程,首先搜索进程的PID进程ID,然后使用带有PID的kill命令.喜欢

$**kill -9 342**

从流程列表中可以看出,您可以使用不同的权限多次启动相同的流程.所以我建议你除了一个需要的东西之外杀死所有人.

编辑:
这个单一命令就足够了;

$ps ax | grep 'Momomoko.E01.140011.HDTV.H264.720p.mp4' | awk -F ' ' '{PRint $1}' | xargs sudo kill -9

这是它的作用:

脚本宝典总结

以上是脚本宝典为你收集整理的php – Pkill -f不适用于进程终止全部内容,希望文章能够帮你解决php – Pkill -f不适用于进程终止所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。