id: 224ad0df1fc341849fb0b31d3e9da06c
parent_id: 
item_type: 1
item_id: 5e53ffea67f548989c83b9056b1f96d4
item_updated_time: 1764345625323
title_diff: "[{\"diffs\":[[1,\"8个Linux进程管理命令详解及示例（四）：kill、pkill 和 killall 命令\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":45}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>8个Linux进程管理命令详解及示例（四）：kill、pkill 和 killall 命令</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <meta name=\\\"content-class\\\" content=\\\"yinxiang.peso.superNote\\\"/>\\\r\\\n  <meta name=\\\"application-data:yinxiang.noteLayout\\\" content=\\\"{\\\"lineSpace\\\":\\\"recommend\\\",\\\"paragraphSpace\\\":\\\"recommend\\\"}\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"38969\\\"></a>\\\r\\\n<h1>8个Linux进程管理命令详解及示例（四）：kill、pkill 和 killall 命令</h1>\\\r\\\n\\\r\\\n<div><span><div><br/></div><p><br/></p><div style=\\\"--en-blockquote:true;box-sizing: border-box; padding-left: 19px; padding-top: 6px; padding-bottom: 6px; border-left: 3px solid #b4c0cc; background-position: initial initial; background-repeat: initial initial; margin-top: 6px\\\"><div>原文链接: <a href=\\\"http://mp.weixin.qq.com/s?__biz=MzUyMTYwMDYxMA==&amp;mid=2247500752&amp;idx=1&amp;sn=0c06023a66717ec100ab4915eb4f4461&amp;chksm=f842bf711f59df7ea1f405029342221e64c43cd739aa3b70dd1e8c8a4f536626ffd571c91ae5&amp;mpshare=1&amp;scene=1&amp;srcid=0322bLiaL6lejZo9YxnpPcQB&amp;sharer_shareinfo=ba9fb96a69b5097118311651b098345f&amp;sharer_shareinfo_first=ba9fb96a69b5097118311651b098345f#rd\\\" rev=\\\"en_rl_none\\\">http://mp.weixin.qq.com/s?__biz=MzUyMTYwMDYxMA==&amp;mid=2247500...</a></div></div><p><br/></p><div><br/></div><h1 style=\\\"other-props:eyJibG9ja0lkIjoiM19oT1JLNlJnbTMifQ==;\\\"> 8个Linux进程管理命令详解及示例（四）：kill、pkill 和 killall 命令 </h1><div>原创 Shad0w-top  Python运维实践 </div><img src=\\\":/48910d4401df4db18a9c80c8a0bb5c01\\\" type=\\\"image/gif\\\" data-filename=\\\"640.gif\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/><div><br/></div><h4 style=\\\"other-props:eyJibG9ja0lkIjoiNmFSa1JDamx4Tk0ifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif;\\\"><span style=\\\"color: #021eaa;\\\"><b><span style=\\\"font-weight: bold;\\\">1.kill命令</span></b></span></span></span></h4><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 命令用于消除 Linux 命令行中的进程。</p><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">有时，会遇到消耗大量资源的进程，并希望尽快停止（或终止）它，那么这时候就要用到 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 命令。</p><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><b><span style=\\\"font-weight: bold;\\\"># </span></b></span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\"><b><span style=\\\"font-weight: bold;\\\">kill</span></b></span></span></code></span><b><span style=\\\"font-weight: bold;\\\"> 命令的语法及含义</span></b></p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:9S93TieFrfx;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #e6c07b;\\\">kill</span> [option] [signal] PID\\\n</div><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: #ff4c41;\\\">[</span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">option</span></span></code></span><span style=\\\"color: #ff4c41;\\\">]：用于微调 </span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">kill</span></span></code></span><span style=\\\"color: #ff4c41;\\\"> 命令的默认行为。</span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: #ff4c41;\\\">[</span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">signal]</span></span></code></span><span style=\\\"color: #ff4c41;\\\">：在这里指定希望用来终止进程的 </span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">kill</span></span></code></span><span style=\\\"color: #ff4c41;\\\"> 信号。</span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">PID</span></span></code></span><span style=\\\"color: #ff4c41;\\\">：要终止的进程的进程 ID。</span></div></li></ul><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">首先，来看看 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 命令的可用选项：</p><table style=\\\"--en-fitwindow:false;border-left:1px solid #d9d9d9;border-top:1px solid #d9d9d9;border-collapse:collapse;width:380px;\\\" width=\\\"380px\\\"><colgroup><col style=\\\"width: 190px;\\\"></col><col style=\\\"width: 190px;\\\"></col></colgroup><tbody><tr><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:initial;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><span style=\\\"font-weight: bold;\\\">选项</span></span></span></div></th><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:initial;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><span style=\\\"font-weight: bold;\\\">描述</span></span></span></div></th></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-s</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>通过名称或数字指定要发送的信号（例如，-s SIGINT 或 -s  2）。此选项允许向进程发送特定信号，而不是默认的 SIGTERM 信号。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-q</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>使用 sigqueue(3) 而不是 kill(2)  发送信号，允许随信号一起发送一个额外的整数值。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-l</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>列出所有信号名称及其对应的值。此选项提供所有可用信号的列表及其数值。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-L</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>以更友好的格式列出所有信号名称。类似于 -l  选项，但以更易读的格式显示信号名称及其描述。</div></td></tr></tbody></table><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">使用 kill 命令的可用信号：</span></span></p><table style=\\\"--en-fitwindow:false;border-left:1px solid #d9d9d9;border-top:1px solid #d9d9d9;border-collapse:collapse;width:570px;\\\" width=\\\"570px\\\"><colgroup><col style=\\\"width: 190px;\\\"></col><col style=\\\"width: 190px;\\\"></col><col style=\\\"width: 190px;\\\"></col></colgroup><tbody><tr><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:initial;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><span style=\\\"font-weight: bold;\\\">信号名称</span></span></span></div></th><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:initial;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><span style=\\\"font-weight: bold;\\\">信号值</span></span></span></div></th><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:initial;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><span style=\\\"font-weight: bold;\\\">描述</span></span></span></div></th></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">SIGHUP</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>1</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>挂起信号，用于重启或重新加载进程。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">SIGINT</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>2</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>中断信号，当按下 Ctrl+C 时发送。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">SIGQUIT</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>3</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>退出信号，用于生成进程的核心转储文件。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">SIGILL</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>4</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>非法指令信号，当进程尝试执行非法指令时发送。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">SIGTERM</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>15</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>终止信号，kill 命令默认发送的信号。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">SIGKILL</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>9</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>强制终止信号，立即终止进程。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">SIGSTOP</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>19</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>停止信号，用于暂停或挂起进程。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">SIGCONT</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>18</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>继续信号，用于恢复被挂起的进程。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">SIGTSTP</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>20</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>终端停止信号，当按下 Ctrl+Z 时发送。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">SIGCHLD</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>17</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>子进程信号，当子进程终止或停止时发送给父进程。</div></td></tr></tbody></table><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">如果在执行 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 命令时不指定 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 信号，它将利用 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">SIGTERM</span></span></code></span> 信号来终止进程。</p><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">下面列举 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 命令的日常使用实例：</p><h5 style=\\\"other-props:eyJibG9ja0lkIjoic3owMFF5d0hObUEifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: #0052ff;\\\"><span style=\\\"font-weight: bold;\\\">1.1终止进程</span></span></span></h5><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">要使用 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 命令终止进程，只需为 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 命令指定 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">PID</span></span></code></span>，它就会终止进程：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:kqWMRmknIUr;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #e6c07b;\\\">kill</span> &lt;PID&gt;\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">例如，想终止Slack 桌面，就用 PID 78210 来终止 ：</span></span></p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:ocfiSuIe8bI;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #e6c07b;\\\">kill</span> 78210\\\n</div><img src=\\\":/625ba838648445f3b698562d6a54bc42\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif;\\\"><span style=\\\"color: rgb(0,0,0);\\\">此外，如果要一次杀死多个进程，可以指定它们的 PID，以空格分隔，如下所示：</span></span></span></p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:n0VCTiIg9QG;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #e6c07b;\\\">kill</span> PID1 PID2 PIDn\\\n</div><img src=\\\":/7df81254d91046789e973b188c67add8\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/><h5 style=\\\"other-props:eyJibG9ja0lkIjoib1RuUlRlMmNBcU8ifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif;\\\"><span style=\\\"color: #0052ff;\\\"><span style=\\\"font-weight: bold;\\\">1.2通过指定 kill 信号终止进程</span></span></span></span></h5><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">在大多数情况下，默认的 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 信号可以完成工作，但如果想使用特定的信号怎么办？这时可以用 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">-s</span></span></code></span> 标志。</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:O1R4ROZLDYx;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #e6c07b;\\\">kill</span> -s &lt;SIGNAL-NAME/SIGNAL-NUMBER&gt; PID\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">例如，用 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">SIGKILL</span></span></code></span> 信号来终止PID为3532的进程:</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:BkWwQOk71Pv;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #e6c07b;\\\">kill</span> -s SIGKILL 3532\\\n</div><img src=\\\":/0f76118d3b1f4e718e2834ef7b026d91\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/><h5 style=\\\"other-props:eyJibG9ja0lkIjoiXzZzTVFxcVBvUkQifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif;\\\"><span style=\\\"color: #0052ff;\\\"><span style=\\\"font-weight: bold;\\\">1.3列出可用的 kill 信号</span></span></span></span></h5><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">要列出可用的 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 信号，请使用 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">-L</span></span></code></span> 如下所示的标志：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:zcIBQauNKe_;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #e6c07b;\\\">kill</span> -L\\\n</div><img src=\\\":/3c9922fdc1be43969bab943f303ef9b1\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif;\\\"><span style=\\\"color: rgb(0,0,0);\\\">仔细观察，上面的输出会重复 </span></span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 信号。</p><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">要解决此问题，可以使用 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 信号的独立版本来列出可用的 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 信号：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:xuZdSyc5bMB;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">/usr/bin/<span style=\\\"color: #e6c07b;\\\">kill</span> -L\\\n</div><img src=\\\":/e2d746c37ff9414790af2707df5d5961\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/><h5 style=\\\"other-props:eyJibG9ja0lkIjoiYl9ZSVEtOVZNWkwifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif;\\\"><span style=\\\"color: #0052ff;\\\"><span style=\\\"font-weight: bold;\\\">1.4使用数字查找 kill 信号名称</span></span></span></span></h5><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">如果现在有一个 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill signal</span></span></code></span> 编号，可以使用 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">-l</span></span></code></span> 标志来查找它的名称：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:B3h_Sa0tQVr;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #e6c07b;\\\">kill</span> -l &lt;Signal-number&gt;\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">例如，如果想知道编号为 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">18</span></span></code></span> 的 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 信号的名称，可以使用以下命令：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:R2_SSCZv6zQ;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #e6c07b;\\\">kill</span> -l 18\\\n</div><img src=\\\":/5fbf724dccf145a7b8e0273d7206fd56\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/><h4 style=\\\"other-props:eyJibG9ja0lkIjoiVlc2UFNLYjRFVjcifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif;\\\"><span style=\\\"color: #021eaa;\\\"><b><span style=\\\"font-weight: bold;\\\">2.pkill命令</span></b></span></span></span></h4><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">pkill</span></span></code></span> 命令也是用于终止 Linux 中的进程。</p><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\"><b><span style=\\\"font-weight: bold;\\\"><i>kill</i></span></b></span></span></code></span><span style=\\\"color: #ff4c41;\\\"><b><span style=\\\"font-weight: bold;\\\"><i> 和 </i></span></b></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\"><b><span style=\\\"font-weight: bold;\\\"><i>pkill </i></span></b></span></span></code></span><span style=\\\"color: #ff4c41;\\\"><b><span style=\\\"font-weight: bold;\\\"><i>命令之间的区别在于，</i></span></b></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\"><b><span style=\\\"font-weight: bold;\\\"><i>kill</i></span></b></span></span></code></span><span style=\\\"color: #ff4c41;\\\"><b><span style=\\\"font-weight: bold;\\\"><i> 命令仅适用于</i></span></b></span><span style=\\\"color: #0080ff;\\\"><b><span style=\\\"font-weight: bold;\\\"><i>进程 ID</i></span></b></span><span style=\\\"color: #ff4c41;\\\"><b><span style=\\\"font-weight: bold;\\\"><i>，而 </i></span></b></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\"><b><span style=\\\"font-weight: bold;\\\"><i>pkill</i></span></b></span></span></code></span><span style=\\\"color: #ff4c41;\\\"><b><span style=\\\"font-weight: bold;\\\"><i> 命令仅适用于</i></span></b></span><span style=\\\"color: #0080ff;\\\"><b><span style=\\\"font-weight: bold;\\\"><i>进程名称</i></span></b></span><span style=\\\"color: #ff4c41;\\\"><b><span style=\\\"font-weight: bold;\\\"><i>。</i></span></b></span></p><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">pkill</span></span></code></span> 命令语法如下：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:Nf4QRuFXMoA;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">pkill [options] pattern\\\n</div><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: #ff4c41;\\\">[</span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">options</span></span></code></span><span style=\\\"color: #ff4c41;\\\">]：使用可用选项，可以修改 </span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">pkill</span></span></code></span><span style=\\\"color: #ff4c41;\\\"> 命令的默认行为。例如，使用 </span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">-u</span></span></code></span><span style=\\\"color: #ff4c41;\\\">标志，可以终止特定于用户的进程。</span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">pattern</span></span></code></span><span style=\\\"color: #ff4c41;\\\">：用于终止进程的名称或模式，可以是进程名称、正则表达式或其他条件。</span></div></li></ul><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">pkill</span></span></code></span> 命令的可用选项如下：</p><table style=\\\"--en-fitwindow:false;border-left:1px solid #d9d9d9;border-top:1px solid #d9d9d9;border-collapse:collapse;width:380px;\\\" width=\\\"380px\\\"><colgroup><col style=\\\"width: 190px;\\\"></col><col style=\\\"width: 190px;\\\"></col></colgroup><tbody><tr><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:initial;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><span style=\\\"font-weight: bold;\\\">选项</span></span></span></div></th><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:initial;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><span style=\\\"font-weight: bold;\\\">描述</span></span></span></div></th></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-u USER</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>仅终止指定用户拥有的进程。可以提供用户名或用户ID。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-f</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>根据完整命令行终止进程，而不仅仅是进程名称。允许终止命令行中包含特定参数或选项的进程。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-x</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>仅终止名称与提供的模式完全匹配的进程。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-n</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>仅终止符合条件的最新启动的进程。当有多个同名进程时，此选项有助于仅终止最新的进程。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-s SESSIONID</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>仅终止属于指定会话ID的进程。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-P PID</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>仅终止父进程ID与指定ID匹配的进程。允许终止特定父进程的子进程。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-g GROUPID</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>仅终止属于指定进程组ID的进程。进程组是共享相同进程组ID的相关进程集合。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-o</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>仅终止符合条件的运行时间最长的进程。当希望终止运行时间最长的进程时，此选项非常有用。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-SIGNAL</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>指定要发送给目标进程的信号。默认情况下，pkill 发送  SIGTERM 信号。</div></td></tr></tbody></table><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">下面列举 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">pkill</span></span></code></span> 命令的一些实例：</p><h5 style=\\\"other-props:eyJibG9ja0lkIjoiQWs0R1IyQXhZY2kifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: #0080ff;\\\"><span style=\\\"font-weight: bold;\\\">2.1按名称终止进程</span></span></span></h5><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:CqqOTyKjmsO;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">pkill process-name\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">例如，如果想终止 </span><span style=\\\"color: rgb(0, 0, 0);\\\"><b><span style=\\\"font-weight: bold;\\\">firefox</span></b></span> ，那么可以使用以下命令：</span></p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:Cvd-RmfXAw5;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">pkill firefox\\\n</div><h5 style=\\\"other-props:eyJibG9ja0lkIjoicnd4SVRpZnU4OEMifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: #0080ff;\\\"><span style=\\\"font-weight: bold;\\\">2.2终止其他用户的进程</span></span></span></h5><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><b><span style=\\\"font-weight: bold;\\\">注：</span></b></span><span style=\\\"color: #ff4c41;\\\"><i>要终止其他用户的进程，需要超级用户权限。</i></span></span></p><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">如果要终止其他用户的进程，使用 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">-u</span></span></code></span> 标志，同进附加用户名和进程名称来完成：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:NKePS6qh_m8;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">sudo pkill -u &lt;username&gt; &lt;process-name&gt;\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">例如，使用以下命令终止用户  kabir 的活动进程 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">htop</span></span></code></span> ：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:7XExR-0CgzV;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">sudo pkill -u kabir htop\\\n</div><img src=\\\":/66b28c06e3bc4a7bb519c602e11d6cbb\\\" type=\\\"image/gif\\\" data-filename=\\\"640.gif\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/><h5 style=\\\"other-props:eyJibG9ja0lkIjoiRlg5MFR5SzFVcngifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif;\\\"><span style=\\\"color: #0080ff;\\\"><span style=\\\"font-weight: bold;\\\">2.3基于整个命令行的 kill 进程</span></span></span></span></h5><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">假设正在运行一个具有多个参数的脚本，现在想要终止使用特定参数执行的脚本。在这种情况下，可以使用带 -</span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">f </span></span></code></span>标志的 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">pkill</span></span></code></span> 命令：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:JR2NQitMkZv;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">pkill -f <span style=\\\"color: #98c379;\\\">&quot;process-name --arg1 value1 --arg2 value2&quot;</span>\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">例如，正在运行一个名为 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">my_script.sh</span></span></code></span> 具有 3 个参数的脚本：<span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">--file input.txt</span></span></code></span>、<span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">--output output.txt</span></span></code></span> 和<span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">--timeout 30</span></span></code></span>，执行方法如下：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:MpMLS-eaMDJ;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">pkill -f <span style=\\\"color: #98c379;\\\">&quot;./my_script.sh --file input.txt --output output.txt --timeout 30&quot;</span>\\\n</div><img src=\\\":/92b35fe9bd6445319fe31bba80cd1899\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/><h5 style=\\\"other-props:eyJibG9ja0lkIjoiVGhpT1R5RV9KQlMifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif;\\\"><span style=\\\"color: #0080ff;\\\"><span style=\\\"font-weight: bold;\\\">2.4终止具体的进程</span></span></span></span></h5><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">使用 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">pkill</span></span></code></span> 命令终止进程时，它可能会终止以相同名称开头的进程。</p><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">当我使用 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">pkill firefox</span></span></code></span> 时，它终止了 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">Firefox</span></span></code></span> 浏览器。但实际的进程名称是 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">firefox-bin</span></span></code></span> ，这意味着它终止了以字符串 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">firefox</span></span></code></span> 开头的进程。</p><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">要按进程的确切名称终止进程，需使用 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">-x</span></span></code></span> 标志：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:lcjWTWdOTXr;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">pkill -x process-name\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">下面命令是用 Firefox 浏览器的确切名称来终止它的：</span></span></p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:olcgRGwLl03;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">pkill -x firefox-bin\\\n</div><h5 style=\\\"other-props:eyJibG9ja0lkIjoiVDVwUFJxMno4WGQifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: #0080ff;\\\"><span style=\\\"font-weight: bold;\\\">2.5在 pkill 命令中使用不同的 kill 信号</span></span></span></h5><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">默认情况下，对于大多数进程，</span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">pkill</span></span></code></span> 使用 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">SIGTERM</span></span></code></span> 信号，它是终止进程的一种礼貌方式。</p><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">要使用其他 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 信号，可以使用以下语法：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:5CiER620JyH;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">pkill -&lt;signal_number/signal_flag&gt; process\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">以下是一些可以与 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">pkill</span></span></code></span>命令一起使用的常用 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 信号：</p><table style=\\\"--en-fitwindow:false;border-left:1px solid #d9d9d9;border-top:1px solid #d9d9d9;border-collapse:collapse;width:570px;\\\" width=\\\"570px\\\"><colgroup><col style=\\\"width: 190px;\\\"></col><col style=\\\"width: 190px;\\\"></col><col style=\\\"width: 190px;\\\"></col></colgroup><tbody><tr><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:initial;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><span style=\\\"font-weight: bold;\\\">信号标志</span></span></span></div></th><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:initial;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><span style=\\\"font-weight: bold;\\\">信号值</span></span></span></div></th><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:initial;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><span style=\\\"font-weight: bold;\\\">描述</span></span></span></div></th></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">HUP</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>1</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>挂起信号，用于重新加载或重启进程。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">INT</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>2</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>中断信号，用于中断进程（通常通过 Ctrl+C 触发）。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">QUIT</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>3</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>退出信号，用于终止进程并生成核心转储文件。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">KILL</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>9</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>强制终止信号，用于强制终止进程，不允许进程进行清理操作。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">TERM</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>15</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>终止信号，用于优雅地终止进程（默认信号）。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">STOP</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>19</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>停止信号，用于暂停进程的执行。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">TSTP</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>20</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>终端停止信号，用于停止或暂停进程（通常通过 Ctrl+Z 触发）。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">CONT</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div>18</div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;\\\"><div>继续信号，用于恢复已停止或暂停的进程。</div></td></tr></tbody></table><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">例如，如果想使用 KILL 信号终止 Firefox 浏览器，可以通过两种方式来实现。可以直接使用 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 信号：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:L90BQOsGLaR;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">pkill -9 firefox-bin\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">或者，可以按以下方式指定想要使用的 KILL信号：</span></span></p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:7BAiRmloIIX;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">pkill -KILL firefox-bin\\\n</div><h4 style=\\\"other-props:eyJibG9ja0lkIjoiTlhSalN5bGNIdlYifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: #021eaa;\\\"><b><span style=\\\"font-weight: bold;\\\">3.killall 命令</span></b></span></span></h4><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">Linux 中的 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">killall</span></span></code></span> 命令允许使用进程名称终止进程。也可以使用 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">kill</span></span></code></span> 命令执行相同的作，但它需要一个特定的选项来使用进程名称而不是 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">PID</span></span></code></span>。</p><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">其语法格式为：</span></span></p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:B9KdQCRtsQp;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">killall [OPTIONS] name\\\n</div><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">[OPTIONS]</span></span></code></span><span style=\\\"color: #ff4c41;\\\">：可选标志（也称为选项），用于修改 </span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">killall</span></span></code></span><span style=\\\"color: #ff4c41;\\\"> 命令的默认行为。例如，可以使用</span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">-I</span></span></code></span><span style=\\\"color: #ff4c41;\\\">选项 执行不区分大小写的搜索。</span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #ff4c41;\\\">name</span></span></code></span><span style=\\\"color: #ff4c41;\\\">：要终止的进程的名称。</span></div></li></ul><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">killall</span></span></code></span> 命令的可用选项：</p><table style=\\\"--en-fitwindow:false;border-left:1px solid #d9d9d9;border-top:1px solid #d9d9d9;border-collapse:collapse;width:380px;\\\" width=\\\"380px\\\"><colgroup><col style=\\\"width: 190px;\\\"></col><col style=\\\"width: 190px;\\\"></col></colgroup><tbody><tr><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:initial;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><span style=\\\"font-weight: bold;\\\">选项</span></span></span></div></th><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:initial;border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0, 0, 0);\\\"><span style=\\\"font-weight: bold;\\\">描述</span></span></span></div></th></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-e</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div>要求进程名称完全匹配。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-I</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div>以不区分大小写的方式匹配进程名称。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-i</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div>在终止进程之前交互式地请求确认。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-q</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div>如果未找到进程，则抑制错误消息。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-r</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div>将进程名称解释为正则表达式。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-s SIGNAL</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div>指定要发送的信号以终止进程（默认为 SIGTERM）。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-u USER</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div>终止指定用户拥有的进程。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-v</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div>报告信号是否成功发送（详细输出）。</div></td></tr><tr style=\\\"background-attachment:scroll; background-clip:border-box; background-image:none; background-origin:padding-box; background-position-x:0%; background-position-y:0%; background-repeat-x:no-repeat; background-repeat-y:no-repeat; background-size:auto; width:auto; height:auto;\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:center;\\\"><div><span style=\\\"color: rgb(0, 0, 0);\\\">-w</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div>等待所有被终止的进程完全结束。</div></td></tr></tbody></table><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">下面列举</span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">killall</span></span></code></span> 命令的实际示例：</p><h5 style=\\\"other-props:eyJibG9ja0lkIjoidWhZbFMyd1o3WlAifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: #0080ff;\\\"><span style=\\\"font-weight: bold;\\\">3.1终止特定进程</span></span></span></h5><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:53CUQqzkFIT;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">killall process-name\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">例如，如果想要终止</span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\"> htop</span></span></code></span> ，那么可以使用以下命令：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:vwW3Q6fbtyj;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">killall htop\\\n</div><img src=\\\":/bcb870e462e24ca49a50cbac1020af82\\\" type=\\\"image/gif\\\" data-filename=\\\"640.gif\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/><h5 style=\\\"other-props:eyJibG9ja0lkIjoiSS1fTlQyT3VIQS0ifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif;\\\"><span style=\\\"color: #0080ff;\\\"><span style=\\\"font-weight: bold;\\\">3.2发送特定的 kill 信号</span></span></span></span></h5><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">默认情况下，</span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">killall</span></span></code></span> 命令使用 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">SIGTERM</span></span></code></span> 终止信号，这在大多数情况下已经足够了，但有时在终止进程时，可能预计会出现不同的行为。</p><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">killall</span></span></code></span> 命令允许从多个要终止信号中进行选择。要使用多个终止信号，请将<span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">-s</span></span></code></span> 标志与终止信号一起使用，如下所示：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:L9Z5S2Xsw2_;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">killall -s &lt;Termination_Signal&gt; process\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">例如，如果想使用 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">SIGKILL</span></span></code></span> 信号终止 <span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">apache2</span></span></code></span> 进程，那么使用以下命令：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:PondRyNnOok;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">killall -s SIGKILL apache2\\\n</div><h5 style=\\\"other-props:eyJibG9ja0lkIjoiVUdaLVIyUXcwc1AifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: #0080ff;\\\"><span style=\\\"font-weight: bold;\\\">3.3以交互方式终止进程</span></span></span></h5><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">采用 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">-i</span></span></code></span>选项来实现：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:zjkXSG02sB1;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">killall -i process\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">例如，下面在终止 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">htop</span></span></code></span> 进程时使用了交互式提示符：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:eTlcSGS_i6r;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">killall -i htop\\\n</div><img src=\\\":/ddff185f06884b3b816cdc7c55f74a07\\\" type=\\\"image/gif\\\" data-filename=\\\"640.gif\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/><h5 style=\\\"other-props:eyJibG9ja0lkIjoiVThpZFNTUTFfUzcifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif;\\\"><span style=\\\"color: #0080ff;\\\"><span style=\\\"font-weight: bold;\\\">3.4终止特定用户拥有的进程</span></span></span></span></h5><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">当尝试终止其他用户拥有的进程时，它会显示一条错误消息：“Operation not permitted”。</span></span></p><img src=\\\":/a1bb3df085684a6aaa330b7b185ffd52\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif;\\\"><span style=\\\"color: rgb(0,0,0);\\\">要终止特定用户拥有的进程，可以使用 </span></span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">-u</span></span></code></span> 标志指定用户名和进程名称，如下所示：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:f1uURi6ggLk;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">sudo killall -u &lt;username&gt; process\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">例如，如果想终止用户 team 拥有的 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">htop</span></span></code></span> 进程，那么使用以下命令：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:y58jTSx2C6D;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">sudo killall -u team htop\\\n</div><h5 style=\\\"other-props:eyJibG9ja0lkIjoiTXpoQVJDOTd5TzMifQ==;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: #0080ff;\\\"><span style=\\\"font-weight: bold;\\\">3.5使用正则表达式终止进程</span></span></span></h5><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">如果想一次杀死多个进程，那么可以使用正则表达式，要使用正则表达式，必须使用如下所示的 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: rgb(30, 107, 184);\\\">-r</span></span></code></span> 标志：</p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:UeguRehl7UB;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"><span style=\\\"color: #e6c07b;\\\">kill</span> -r REGEX\\\n</div><p style=\\\"color:rgb(0, 0, 0);\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: rgb(0,0,0);\\\">例如，如果想终止名称以“</span><span style=\\\"color: rgb(0, 0, 0);\\\"><b><span style=\\\"font-weight: bold;\\\">http</span></b></span>”开头的所有进程，例如“<span style=\\\"color: rgb(0, 0, 0);\\\"><b><span style=\\\"font-weight: bold;\\\">httpd</span></b></span>”或“<span style=\\\"color: rgb(0, 0, 0);\\\"><b><span style=\\\"font-weight: bold;\\\">http-server</span></b></span>”，可以使用以下命令：</span></p><div style=\\\"background-color:rgb(40, 44, 52);\\\"><br/></div><div style=\\\"--en-codeblock:true;--en-blockId:Re7tSS_s8dM;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">killall -r <span style=\\\"color: #98c379;\\\">'http.*'</span>\\\n</div><img src=\\\":/c157596dfee24c6e88840f35b983df85\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks:%7B%22align%22%3A%22center%22%7D;--en-uploadstate:uploaded;\\\"/></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":97756}]"
metadata_diff: {"new":{"id":"5e53ffea67f548989c83b9056b1f96d4","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348815790,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:03:15.050Z
created_time: 2025-11-28T21:03:15.050Z
type_: 13