5

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)
0

2 Answers 2

12

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.

Sign up to request clarification or add additional context in comments.

2 Comments

@user2983041. You are welcome, I have used this on occasion with rogue psql and java processes that can't be stopped by normal means. Also, I see you are new to SO, so welcome, but if someone solves a problem for you, it is considered polite to accept the answer :D
This is the only thing that worked for me and my python threading adventures gone awry.
1

Have you tried:

killall python or killall python2.7

Assuming python2.7 is what you are using.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.