Name

kill

Synopsis

    kill [options]IDs

Terminate each specified process ID or job ID. You must own the process or be a privileged user. This built-in is similar to the external kill command described in Chapter 2 but also allows symbolic job names. See the kill entry in Chapter 2 for a list of commonly available signals and for the header files where the corresponding signal numbers may be found. Stubborn processes can be killed using signal 9. See also the earlier section "Job Control.”

Options

-l

List the signal names. (Used by itself.)

-signal, -ssignal

Send the given signal to the jobs specified by IDs. The signal is either a signal number, or a signal name without the SIG prefix (e.g., HUP, not SIGHUP).

Examples

If you’ve issued the following command:

    44% nroff -ms report > report.txt &
    [1] 19536tcsh prints job and process IDs

you can terminate it in any of the following ways:

    45% kill 19536          
                     Process ID
    45% kill %              
                     Current job
    45% kill %1             
                     Job number 1
    45% kill %nr            
                     Initial string
    45% kill %?reportMatching string

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.