How do I kill a proccess?
I run ps aux and see a proccess that I dont want running. How do I end/kill that proccess?
|
i.e.
kill -KILL 1337 |
man kill
kill -9 pid will kill with no questions asked. |
and basically KILL and signal 9 are the same thing
|
Quote:
|
I am doing it to, I prefer numbering theme as opposed to holding the shift key and typing the whole signal name :) I was just showing that there's no difference, so everything is clear.:rolleyes:
|
kill(1), without any switches, defaults to kill -15, which signals the process to shut itself down. This is generally the perferable way of shutting down a process, since the process will close all opened files, shutdown down any child processes, and return all resources back to the system. The problem is that not all processes are written to catch signal 15. In those cases, and cases in which a process may get hung up in a loop, you would use kill -9. In this case, the kernel is doing an immediate shutdown of a process. This form of killing is done as a last resort, since not all resources may be returned to the system. -mk
|
kill `ps -e | awk '/<process-name>/{print $1}'` This is useful because you don't have to know the pid or the exact name of the process. Ex. To kill mozilla, you would do kill `ps -e | awk '/mozilla/{print $1}'`
|
When I don't know a process pid, I prefer pkill. I rather use signal names instead of number, because I have doubts all the time. With names, I won't make a mistake :)
|
All times are GMT -5. The time now is 08:30 AM. |