http://linux.byexamples.com/archives/157/kill-process-with-care/#comments
How to kill a process?
To kill a process, you need to know its process ID (PID). The easiest way to check is by ps with grep, let say I wanna check the PID of gaim.
=> ps aux | grep gaim
Let say it returns PID with numbers 5678, Then now you can kill and check with ps and grep again to confirm whether the process have successfully kill.
=> kill 5678
Alternatively, you can kill processes by specified process name using pkill, again I wanna kill gaim.
=> pkill gaim
How to force kill a process?
You can choose a signal to send to the process, checks the kill manual for available signals to send.
=> man kill
Usually if you process was unable to kill, first check whether you need to have root privilege to kill? certain process is instantiate by root, to kill you must have the same level of privilege.
=> sudo kill 5678
Second, try to kill with -1 and -2 before uses -9.
=> kill -1 5678
Okay, the process is really irritating, let me force kill it,
=> kill -9 5678
Some process may have multiple instances, killing the process one by one with PID is nightmare, so kill them all one shot!
=> killall gaim
Still there? grrrrrrrrrr!
=> sudo killall -9 gaim
'TIP' 카테고리의 다른 글
cat /proc/meminfo (0) | 2009.09.03 |
---|---|
ldd (0) | 2009.09.03 |
so file 생성 (0) | 2009.07.12 |
VNC multi-user setting (0) | 2009.05.26 |
환경변수 설정 (0) | 2009.05.22 |