How to Kill Process or Terminate a Process in Linux/Unix Example
To kill any process in Linux or Unix box use kill command. Below is the example is given which will first list out the processes with ps command as described in previous chapter, then it will kill the process using kill command by passing process id as parameter.
To list the process, give the ps command as following:
$ ps -ef | grep pmon
The sample output of the above command is:
oracle 1982 1 0 Dec 02 ? 09:01 ora_pmon_fox
oracle 8339 1 0 Dec 02 ? 09:08 ora_pmon_vin
Now suppose you want to kill the process with id 8339 use the kill command as following:
$ kill -9 8339
The -9 option will send a kill signal to the process to terminate.
You can view all the signal available with kill command as following:
$ kill -l