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
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.