LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How do I kill a proccess? (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-kill-a-proccess-27533/)

bripage 08-08-2002 10:00 PM

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?

jetblackz 08-08-2002 10:27 PM

i.e.

kill -KILL 1337

trickykid 08-08-2002 10:50 PM

man kill

kill -9 pid will kill with no questions asked.

neo77777 08-08-2002 10:56 PM

and basically KILL and signal 9 are the same thing

trickykid 08-08-2002 11:06 PM

Quote:

Originally posted by neo77777
and basically KILL and signal 9 are the same thing
I suggested the -9 cause its shorter to type, for the lazy people out there like me. ;)

neo77777 08-08-2002 11:15 PM

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:

mikek147 08-09-2002 04:16 AM

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

LinuxGeek 08-09-2002 07:41 AM

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}'`

Mara 08-09-2002 08:37 AM

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.