Using kill to terminate a misbehaving process in Linux
In order to work with your computer, you run programs. A running program is also known as a process. Normally, Linux has a lot of processes at any given time. What do you do if one of your running programs aka process stop responding ?
Fortunately, Linux has just the right tool for this scenario. The tool you would use is the
The syntax for kill is as follows :
$ kill -s signal PID
Where signal is the number or name that
kill recognizes and which tells it to do a particular task. You can obtain a list of all the signals using the
kill command as follows :
$ kill -l
And PID is the process id of the misbehaving application or program. The process id is a number.
So if I want to terminate Firefox web browser because it stops responding, I fire up a terminal and first check the process id of Firefox using the
ps command. Then I execute the following
$ kill -s SIGKILL pid-number-of-firefox
Note: You can also use the corresponding number instead of SIGKILL as follows :
$ kill -s 9 pid-number-of-firefox