Files
uTools-Manuals/docs/linux/pkill.html
T

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/ -->