xref: /freebsd/bin/kill/kill.1 (revision 1171aedc)
1.\" Copyright (c) 1980, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Institute of Electrical and Electronics Engineers, Inc.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 4. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"	@(#)kill.1	8.2 (Berkeley) 4/28/95
32.\" $FreeBSD$
33.\"
34.Dd April 28, 1995
35.Dt KILL 1
36.Os
37.Sh NAME
38.Nm kill
39.Nd terminate or signal a process
40.Sh SYNOPSIS
41.Nm
42.Op Fl s Ar signal_name
43.Ar pid
44\&...
45.Nm
46.Fl l
47.Op Ar exit_status
48.Nm
49.Fl Ar signal_name
50.Ar pid
51\&...
52.Nm
53.Fl Ar signal_number
54.Ar pid
55\&...
56.Sh DESCRIPTION
57The
58.Nm
59utility sends a signal to the processes specified by the
60.Ar pid
61operand(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
73If no operand is given, list the signal names; otherwise, write
74the signal name corresponding to
75.Ar exit_status .
76.It Fl Ar signal_name
77A symbolic signal name specifying the signal to be sent instead of the
78default
79.Dv TERM .
80.It Fl Ar signal_number
81A non-negative decimal integer, specifying the signal to be sent instead
82of the default
83.Dv TERM .
84.El
85.Pp
86The following pids have special meanings:
87.Bl -tag -width Ds -compact
88.It -1
89If superuser, broadcast the signal to all processes; otherwise broadcast
90to all processes belonging to the user.
91.El
92.Pp
93Some of the more commonly used signals:
94.Bl -tag -width Ds -compact
95.It 1
96HUP (hang up)
97.It 2
98INT (interrupt)
99.It 3
100QUIT (quit)
101.It 6
102ABRT (abort)
103.It 9
104KILL (non-catchable, non-ignorable kill)
105.It 14
106ALRM (alarm clock)
107.It 15
108TERM (software termination signal)
109.El
110.Pp
111Some shells may provide a builtin
112.Nm
113command which is similar or identical to this utility.
114Consult the
115.Xr builtin 1
116manual page.
117.Sh EXAMPLES
118Terminate
119the processes with pids 142 and 157:
120.Pp
121.Dl "kill 142 157"
122.Pp
123Send the hangup signal
124.Pq Dv SIGHUP
125to the process with pid 507:
126.Pp
127.Dl "kill -s HUP 507"
128.Pp
129Terminate the process group with pgid 117:
130.Pp
131.Dl "kill -- -117"
132.Sh DIAGNOSTICS
133.Ex -std
134.Sh SEE ALSO
135.Xr builtin 1 ,
136.Xr csh 1 ,
137.Xr killall 1 ,
138.Xr ps 1 ,
139.Xr kill 2 ,
140.Xr sigaction 2
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 v3 .
152.Sh BUGS
153A replacement for the command
154.Dq Li kill 0
155for
156.Xr csh 1
157users should be provided.
158