System Administration Guide, Volume 2

How to Kill a Process

  1. (Optional) To kill a process belonging to another user, become superuser.

  2. (Optional) Use output from the pgrep command to obtain the identification number of the process you want to display more information about.


    $ pgrep process
    

    process

    Name of the process you want to display more information about. 

    The process identification number is in the first column of the output.

  3. Use the pkill command to stop the process.


    $ pkill [-9] PID ...
    

    -9

    Ensures that the process terminates promptly. 

    PID . . .

    ID of the process or processes to stop.  

  4. Use the pgrep command to verify that the process has been stopped.


    $ pgrep PID ...