A lots of people likes to do kill -9, which means kill a process by force. By specified -9, process will be terminated by force, which is very fast and confirm kill but it leaves hidden side effects. Refers to Useless use of kill -9, kill a process by specified -9 may leave child processes of a parent orphaned, temporary files open, shared memory segments active, and sockets busy. This leaves the system in a messy state, and could lead to unanticipated and hard to debug problems.
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.
Alternatively, you can kill processes by specified process name using pkill, again I wanna kill 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.
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!
Still there? grrrrrrrrrr!
sudo killall -9 gaim
Haha this is just an example, anyway you usually no need to perform a force kill like that.