Pkill -f doesn't work for process killing

前端 未结 3 486
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-05 10:19

I have this process running:

342 pts/2    T    0:00 sh -c sudo screen /usr/bin/python /usr/bin/btdownloadcurses \"http://zoink.it/torrent/732A4A9B54B7E3A916C2835         


        
3条回答
  •  感情败类
    2021-02-05 10:44

    Try to use kill command rather

    kill -9 
    

    It will work for sure, cause I have tried it myself and very handy all times.

    Use the following in a script file then run for loop with kill command,

    ps|grep torrent|cut -f1 -d' '
    

    like this for loop as shown below, as exact working copy from my system;

    for p in `ps|grep torrent|cut -f1 -d' '`; do
       kill -9 $p
    done
    

    I hope this will help you finally.

    As per latest edited question you want to run this with PHP, it can be implemented through exec command, please follow the question for solution.

提交回复
热议问题