jcs's openbsd hax
openbsd
at jcs 164 lines 4.6 kB view raw
1.\" $OpenBSD: kill.1,v 1.43 2025/04/24 14:15:29 schwarze Exp $ 2.\" $NetBSD: kill.1,v 1.8 1995/09/07 06:30:26 jtc Exp $ 3.\" 4.\" Copyright (c) 1980, 1990, 1993 5.\" The Regents of the University of California. All rights reserved. 6.\" 7.\" This code is derived from software contributed to Berkeley by 8.\" the Institute of Electrical and Electronics Engineers, Inc. 9.\" 10.\" Redistribution and use in source and binary forms, with or without 11.\" modification, are permitted provided that the following conditions 12.\" are met: 13.\" 1. Redistributions of source code must retain the above copyright 14.\" notice, this list of conditions and the following disclaimer. 15.\" 2. Redistributions in binary form must reproduce the above copyright 16.\" notice, this list of conditions and the following disclaimer in the 17.\" documentation and/or other materials provided with the distribution. 18.\" 3. Neither the name of the University nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" @(#)kill.1 8.2 (Berkeley) 4/28/95 35.\" 36.Dd $Mdocdate: April 24 2025 $ 37.Dt KILL 1 38.Os 39.Sh NAME 40.Nm kill 41.Nd terminate or signal a process 42.Sh SYNOPSIS 43.Nm kill 44.Op Fl Ar signal_number | Fl Ar signal_name | Fl s Ar signal_name 45.Ar pid ... 46.Nm kill 47.Fl l 48.Op Ar exit_status 49.Sh DESCRIPTION 50The 51.Nm 52utility sends a signal to the process(es) specified 53by the 54.Ar pid 55operand(s). 56If no signal is specified, the 57.Cm TERM 58signal is used. 59.Pp 60Only the superuser may send signals to other users' processes. 61.Pp 62The options are as follows: 63.Bl -tag -width Ds 64.It Fl l Op Ar exit_status 65Display the name of the signal corresponding to 66.Ar exit_status . 67.Ar exit_status 68may be the exit status of a command killed by a signal 69(see the 70special 71.Xr sh 1 72parameter 73.Sq ?\& ) 74or a signal number. 75.Pp 76If no operand is given, display the names of all the signals. 77.It Fl Ar signal_number | Fl Ar signal_name | Fl s Ar signal_name 78A non-negative decimal integer or a symbolic name 79specifying the signal to be sent instead of the default 80.Cm TERM . 81.El 82.Pp 83The following PIDs have special meanings: 84.Bl -tag -width Ds -offset indent 85.It \-1 86If superuser, broadcast the signal to all processes; otherwise, broadcast 87to all processes belonging to the user. 88.It 0 89Send the signal to all processes whose group ID is equal to the 90process group ID of the sender, and for which the process has permission. 91.It \- Ns Ar pgid 92Send the signal to all processes within the specified process group. 93.El 94.Pp 95Some of the more commonly used signals: 96.Pp 97.Bl -column MM MMMM -compact -offset indent 98.It 1 Ta Cm HUP Ta Pq hang up 99.It 2 Ta Cm INT Ta Pq interrupt 100.It 3 Ta Cm QUIT Ta Pq quit 101.It 6 Ta Cm ABRT Ta Pq abort 102.It 9 Ta Cm KILL Ta Pq non-catchable, non-ignorable kill 103.It 14 Ta Cm ALRM Ta Pq alarm clock 104.It 15 Ta Cm TERM Ta Pq software termination signal 105.El 106.Pp 107For a complete list, consult the 108.Xr signal 3 109manual page. 110.Pp 111A signal number of 0 112.Pq Nm kill Fl 0 Ar pid 113does not send a signal, but only checks the validity of a certain PID. 114It succeeds if 115.Ar pid 116exists or raises an error otherwise. 117.Sh EXIT STATUS 118.Ex -std kill 119.Sh EXAMPLES 120Forcibly terminate process ID 1234: 121.Pp 122.Dl $ kill -9 1234 123.Pp 124Send the 125.Xr init 8 126process the hangup signal, instructing it to re-read 127.Xr ttys 5 : 128.Pp 129.Dl # kill -HUP 1 130.Sh SEE ALSO 131.Xr csh 1 , 132.Xr ksh 1 , 133.Xr pkill 1 , 134.Xr ps 1 , 135.Xr kill 2 , 136.Xr signal 3 137.Sh STANDARDS 138The 139.Nm 140utility is compliant with the 141.St -p1003.1-2008 142specification. 143.Pp 144The 145.Fl Ar signal_name 146and 147.Fl Ar signal_number 148syntax is marked by 149.St -p1003.1-2008 150as being an 151X/Open System Interfaces 152option. 153.Pp 154.Nm 155also exists as a built-in to 156.Xr csh 1 157and 158.Xr ksh 1 , 159though with a different syntax. 160.Sh HISTORY 161A 162.Nm 163command appeared in 164.At v3 .