What is the more easier way to check the pid and kill the pid
What is the more easier way to check the pid and kill the pid? I use the ps ux command to list all the pid but the list is too long already and I use the kill pid to kill the process but it is not successful. So I need to use the kill -9 pid to kill the process. What is -9 mean?
Thx. |
'ps ux | grep programname' will filter the list for only what you want to find.
-9 is basically the "force termination" signal, the one that bypasses all efforts to safely shut down the process. You should only use it when nothing else works. Have a look at the killall and pkill commands, both of which can kill processes by name. They can be a bit dangerous though if you have multiple processes with the same name. Read these manpages for more: man kill man pkill man killall man 7 signal Edit: this page has a simple rundown on Unix signals: http://everything2.com/e2node/unix%2520signals |
Thx a lot for your help.
|
You can also use pidof that gives you the pid of programname:
Code:
kill -9 `pidof programname` |
the easy way
"killall program-name" |
A variation of above
pkill <signal> <application or daemon> |
All times are GMT -5. The time now is 04:35 AM. |