Go to main content

Managing System Information, Processes, and Performance in Oracle® Solaris 11.4

Exit Print View

Updated: August 2021
 
 

How to Terminate a Process With the kill Command

  1. () To terminate a process that you do not own, assume the root role.
  2. Obtain the process ID of the process that you want to terminate.
    # ps -fu user

    where user is the owner of the process.

    The process ID is displayed in the first column of the output.

  3. Terminate the process.
    # kill [signal-number] PID
    signal

    When no signal is included in the kill command-line syntax, the default signal that is used is -15 (SIGKILL). Using the -9 signal (SIGTERM) with the kill command ensures that the process terminates promptly. However, do not use the -9 signal to kill certain processes such as a database process or an LDAP server process because data might be lost.

    PID

    The process ID of the process that you want to terminate.


    Tip  -  When trying to terminate a process, first try using the kill command by itself without a signal option. Wait a few minutes to see if the process terminates before using the kill command with the –9 signal.
  4. Verify that the process has been terminated.
    # ps -ef | grep PID

    The process you terminated should not be listed.