I've run a python script on the command line that can't be killed with ctrl-C (SIGINT).
$ ./bad_script.py
^CTraceback(most recent call last):
...
KeboardInterrupt
^C
^C
...
<I give up>
When I look for this python process on another command line I see many options:
$ pidof python
1111 2222 3333 4444 5555 6666 # Which one is bad_script.py?
I want to kill my bad_script.py process, not the innocents.
Note this is not a duplicate of other questions that are similar because I want to know which process to kill:
You have a number of options. For example you can run the following ps command to list all running programs and use grep:
ps aux | grep bad_script
or if you have access to the source code, you could print the process id inside the script, at the start of the program:
import os
print os.getpid()
or just press Ctrl-\ to kill it in a different way by sending the SIGQUIT signal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With