xref: /netbsd/bin/kill/kill.1 (revision 6550d01e)
1.\"	$NetBSD: kill.1,v 1.21 2007/12/28 14:32:50 wiz Exp $
2.\"
3.\" Copyright (c) 1980, 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" This code is derived from software contributed to Berkeley by
7.\" the Institute of Electrical and Electronics Engineers, Inc.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. Neither the name of the University nor the names of its contributors
18.\"    may be used to endorse or promote products derived from this software
19.\"    without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.\"	@(#)kill.1	8.2 (Berkeley) 4/28/95
34.\"
35.Dd April 28, 1995
36.Dt KILL 1
37.Os
38.Sh NAME
39.Nm kill
40.Nd terminate or signal a process
41.Sh SYNOPSIS
42.Nm
43.Op Fl s Ar signal_name
44.Ar pid
45\&...
46.Nm
47.Fl l
48.Op Ar exit_status
49.Nm
50.Fl signal_name
51.Ar pid
52\&...
53.Nm
54.Fl signal_number
55.Ar pid
56\&...
57.Sh DESCRIPTION
58The
59.Nm
60utility sends a signal to the process(es) specified
61by the pid operand(s).
62.Pp
63Only the super-user may send signals to other users' processes.
64.Pp
65The options are as follows:
66.Pp
67.Bl -tag -width Ds
68.It Fl s Ar signal_name
69A symbolic signal name specifying the signal to be sent instead of the
70default
71.Dv TERM .
72.It Fl l Op Ar exit_status
73Display the name of the signal corresponding to
74.Ar exit_status .
75.Ar exit_status
76may be the exit status of a command killed by a signal
77(see the
78special
79.Xr sh 1
80parameter
81.Sq ?\& )
82or a signal number.
83.Pp
84If no operand is given, display the names of all the signals.
85.It Fl signal_name
86A symbolic signal name specifying the signal to be sent instead of the
87default
88.Dv TERM .
89.It Fl signal_number
90A non-negative decimal integer, specifying the signal to be sent instead
91of the default
92.Dv TERM .
93.El
94.Pp
95The following pids have special meanings:
96.Bl -tag -width Ds -compact
97.It -1
98If superuser, broadcast the signal to all processes; otherwise broadcast
99to all processes belonging to the user.
100.It 0
101Broadcast the signal to all processes in the current process group
102belonging to the user.
103.El
104.Pp
105Some of the more commonly used signals:
106.Bl -tag -width Ds -compact
107.It 1
108HUP (hang up)
109.It 2
110INT (interrupt)
111.It 3
112QUIT (quit)
113.It 6
114ABRT (abort)
115.It 9
116KILL (non-catchable, non-ignorable kill)
117.It 14
118ALRM (alarm clock)
119.It 15
120TERM (software termination signal)
121.El
122.Pp
123.Nm
124is a built-in to
125.Xr csh  1  ;
126it allows job specifiers of the form ``%...'' as arguments
127so process id's are not as often used as
128.Nm
129arguments.
130See
131.Xr csh  1
132for details.
133.Sh SEE ALSO
134.Xr csh 1 ,
135.Xr pgrep 1 ,
136.Xr pkill 1 ,
137.Xr ps 1 ,
138.Xr kill 2 ,
139.Xr sigaction 2 ,
140.Xr signal 7
141.Sh STANDARDS
142The
143.Nm
144function is expected to be
145.St -p1003.2
146compatible.
147.Sh HISTORY
148A
149.Nm
150command appeared in
151.At v6 .
152