📄 kill.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>kill</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="kill"></a> <a name="tag_04_72"></a><!-- kill --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_04_72_01"></a>NAME</h4><blockquote>kill - terminate or signal processes</blockquote><h4><a name="tag_04_72_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><p><code><tt>kill -s</tt> <i>signal_name pid</i> <tt>...<br><br> kill -l</tt> <b>[</b><i>exit_status</i><b>]</b><tt><br><br></tt></code></p><div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> kill</tt> <b>[</b><tt>-</tt><i>signal_name</i><b>]</b> <i>pid</i> <tt>...<br><br> kill</tt> <b>[</b><tt>-</tt><i>signal_number</i><b>]</b> <i>pid</i> <tt>... <img src="../images/opt-end.gif" alt="[Option End]"border="0"></tt></code></div><tt><br></tt></blockquote><h4><a name="tag_04_72_03"></a>DESCRIPTION</h4><blockquote><p>The <i>kill</i> utility shall send a signal to the process or processes specified by each <i>pid</i> operand.</p><p>For each <i>pid</i> operand, the <i>kill</i> utility shall perform actions equivalent to the <a href="../functions/kill.html"><i>kill</i>()</a> function defined in the System Interfaces volume of IEEE Std 1003.1-2001called with the following arguments:</p><ul><li><p>The value of the <i>pid</i> operand shall be used as the <i>pid</i> argument.</p></li><li><p>The <i>sig</i> argument is the value specified by the <b>-s</b> option, <b>-</b> <i>signal_number</i> option, or the <b>-</b><i>signal_name</i> option, or by SIGTERM, if none of these options is specified.</p></li></ul></blockquote><h4><a name="tag_04_72_04"></a>OPTIONS</h4><blockquote><p>The <i>kill</i> utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap12.html#tag_12_02">Section 12.2, Utility Syntax Guidelines</a>, <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> except thatin the last two SYNOPSIS forms, the <b>-</b> <i>signal_number</i> and <b>-</b> <i>signal_name</i> options are usually more than asingle character. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p><p>The following options shall be supported:</p><dl compact><dt><b>-l</b></dt><dd>(The letter ell.) Write all values of <i>signal_name</i> supported by the implementation, if no operand is given. If an<i>exit_status</i> operand is given and it is a value of the <tt>'?'</tt> shell special parameter (see <a href="xcu_chap02.html#tag_02_05_02"><i>Special Parameters</i></a> and <a href="wait.html"><i>wait</i>()</a> ) corresponding to a processthat was terminated by a signal, the <i>signal_name</i> corresponding to the signal that terminated the process shall be written.If an <i>exit_status</i> operand is given and it is the unsigned decimal integer value of a signal number, the <i>signal_name</i>(the symbolic constant name without the <b>SIG</b> prefix defined in the Base Definitions volume of IEEE Std 1003.1-2001)corresponding to that signal shall be written. Otherwise, the results are unspecified.</dd><dt><b>-s </b> <i>signal_name</i></dt><dd><br>Specify the signal to send, using one of the symbolic names defined in the <a href="../basedefs/signal.h.html"><i><signal.h></i></a> header. Values of <i>signal_name</i> shall be recognized in acase-independent fashion, without the <b>SIG</b> prefix. In addition, the symbolic name 0 shall be recognized, representing thesignal value zero. The corresponding signal shall be sent instead of SIGTERM.</dd><dt><b>-</b><i>signal_name</i></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"><br>Equivalent to <b>-s</b> <i>signal_name</i>. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt><b>-</b><i>signal_number</i></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"><br>Specify a non-negative decimal integer, <i>signal_number</i>, representing the signal to be used instead of SIGTERM, as the<i>sig</i> argument in the effective call to <a href="../functions/kill.html"><i>kill</i>()</a>. The correspondence between integervalues and the <i>sig</i> value used is shown in the following table. <p>The effects of specifying any <i>signal_number</i> other than those listed in the table are undefined. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p></dd></dl><br><table border="1" cellpadding="3"><tr valign="top"><th align="center"><p class="tent"><i>signal_number</i></p></th><th align="center"><p class="tent"><b><i>sig</i> Value</b></p></th></tr><tr valign="top"><td align="left"><p class="tent"><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"border="0"> 0</p></td><td align="left"><p class="tent">0</p></td></tr><tr valign="top"><td align="left"><p class="tent">1</p></td><td align="left"><p class="tent">SIGHUP</p></td></tr><tr valign="top"><td align="left"><p class="tent">2</p></td><td align="left"><p class="tent">SIGINT</p></td></tr><tr valign="top"><td align="left"><p class="tent">3</p></td><td align="left"><p class="tent">SIGQUIT</p></td></tr><tr valign="top"><td align="left"><p class="tent">6</p></td><td align="left"><p class="tent">SIGABRT</p></td></tr><tr valign="top"><td align="left"><p class="tent">9</p></td><td align="left"><p class="tent">SIGKILL</p></td></tr><tr valign="top"><td align="left"><p class="tent">14</p></td><td align="left"><p class="tent">SIGALRM</p></td></tr><tr valign="top"><td align="left"><p class="tent">15</p></td><td align="left"><p class="tent">SIGTERM</p></td></tr></table><p>If the first argument is a negative integer, it shall be interpreted as a <b>-</b> <i>signal_number</i> option, not as anegative <i>pid</i> operand specifying a process group. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p></blockquote><h4><a name="tag_04_72_05"></a>OPERANDS</h4><blockquote><p>The following operands shall be supported:</p><dl compact><dt><i>pid</i></dt><dd>One of the following: <ol><li><p>A decimal integer specifying a process or process group to be signaled. The process or processes selected by positive, negative,and zero values of the <i>pid</i> operand shall be as described for the <a href="../functions/kill.html"><i>kill</i>()</a>function. If process number 0 is specified, all processes in the current process group shall be signaled. For the effects ofnegative <i>pid</i> numbers, see the <a href="../functions/kill.html"><i>kill</i>()</a> function defined in the System Interfacesvolume of IEEE Std 1003.1-2001. If the first <i>pid</i> operand is negative, it should be preceded by <tt>"--"</tt> tokeep it from being interpreted as an option.</p></li><li><p>A job control job ID (see the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap03.html#tag_03_203">Section 3.203, Job Control Job ID</a>) that identifies a background process group to besignaled. The job control job ID notation is applicable only for invocations of <i>kill</i> in the current shell executionenvironment; see <a href="xcu_chap02.html#tag_02_12"><i>Shell Execution Environment</i></a> .</p></li></ol></dd><dt><i>exit_status</i></dt><dd>A decimal integer specifying a signal number or the exit status of a process terminated by a signal.</dd></dl></blockquote><h4><a name="tag_04_72_06"></a>STDIN</h4><blockquote><p>Not used.</p></blockquote><h4><a name="tag_04_72_07"></a>INPUT FILES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_72_08"></a>ENVIRONMENT VARIABLES</h4>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -