Press "Enter" to skip to content

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
example of kill process in linux/unix

Vinish Kapoor

FoxInfotech.in is created, written, and maintained by Vinish Kapoor. It is built on WordPress, and hosted by Bluehost. Connect with Vinish on Facebook, Twitter, and GitHub.

You may also like: