Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can´t kill my python script in linux

I'm trying to kill my python process and always still there.

Also try using sudo and if I use top comand, the process is still there.

The python script was created by me, and no other process is continually calling.

ubuntu@ip-*******:~/Desktop/Servidor$ pkill python -e

python killed (pid 1284)

ubuntu@ip-*******:~/Desktop/Servidor$ pkill python -e

python killed (pid 1284)

ubuntu@ip-*******:~/Desktop/Servidor$ pkill python -e

python killed (pid 1284)
like image 515
user2983041 Avatar asked Dec 14 '22 23:12

user2983041


2 Answers

Something you can use that is fairly brutal and will work for any rogue process is:

ps ax | grep python | cut -c1-5 | xargs kill -9

which will probably need to be run as sudo.

like image 138
John Powell Avatar answered Dec 28 '22 15:12

John Powell


Have you tried:

killall python or killall python2.7

Assuming python2.7 is what you are using.

like image 27
Padraic Cunningham Avatar answered Dec 28 '22 15:12

Padraic Cunningham