How can I kill a process by name instead of PID, on Linux? [duplicate]
pkill firefox More information: http://linux.about.com/library/cmd/blcmdl1_pkill.htm
pkill firefox More information: http://linux.about.com/library/cmd/blcmdl1_pkill.htm
If the user or sysadmin did not kill the program the kernel may have. The kernel would only kill a process under exceptional circumstances such as extreme resource starvation (think mem+swap exhaustion).
You want to use backtick, not regular tick: sudo kill -9 `sudo lsof -t -i:9001` If that doesn’t work, you could also use $() for command interpolation: sudo kill -9 $(sudo lsof -t -i:9001)
“kill” will only kill one screen window. To “kill” the complete session, use quit. Example $ screen -X -S [session # you want to kill] quit For dead sessions use: $ screen -wipe
It is generally a bad pattern to kill a thread abruptly, in Python, and in any language. Think of the following cases: the thread is holding a critical resource that must be closed properly the thread has created several other threads that must be killed as well. The nice way of handling this, if you … Read more