2019-04-21 11:50:48 +08:00

22 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="pkill">pkill</h1>
<p>可以按照进程名杀死进程</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>pkill命令</strong> 可以按照进程名杀死进程。pkill和killall应用方法差不多也是直接杀死运行中的程序如果您想杀掉单个进程请用kill来杀掉。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">pkill(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-o仅向找到的最小起始进程号发送信号
-n仅向找到的最大结束进程号发送信号
-P指定父进程号发送信号
-g指定进程组
-t指定开启进程的终端。</code></pre>
<h3 id="参数">参数</h3>
<p>进程名称指定要查找的进程名称同时也支持类似grep指令中的匹配模式。</p>
<h3 id="实例">实例</h3>
<pre><code class="language-bash">pgrep -l gaim
2979 gaim
pkill gaim</code></pre>
<p>也就是说kill对应的是PIDpkill对应的是command。</p>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->