O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 /bin/kill described in Chapter 3 but also allows symbolic job names. Stubborn processes can be killed using signal 9.

Options

-l

List the signal names. (Used by itself.)

- signal, -s signal

The signal number or name without the SIG prefix (e.g., HUP, not SIGHUP). The command kill -l prints a list of the available signal names. The list varies by system architecture; for a PC-based system, it looks like this:

% kill -l
HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2
PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG 
XCPU XFSZ VTALRM PROF WINCH POLL PWR SYS RTMIN RTMIN+1
RTMIN+2 RTMIN+3 RTMAX-3 RTMAX-2 RTMAX-1 RTMAX

The signals and their numbers are defined in /usr/include/asm/signal.h; look in that file to find the signals that apply to your system.

Examples

If you’ve issued the following command:

44% nroff -ms report &

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 %?report  
                  Matching string

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required