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

16 lines
1.3 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="fg">fg</h1>
<p>将后台作业放到前台终端运行</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>fg命令</strong> 用于将后台作业在后台运行的或者在后台挂起的作业放到前台终端运行。与bg命令一样若后台任务中只有一个则使用该命令时可以省略任务号。</p>
<p>在Linux系统中执行某些操作时候有时需要将当前任务暂停调至后台或有时须将后台暂停的任务重启开启并调至前台这一序列的操作将会使用到 jobs、bg、和 fg 三个命令以及两个快捷键来完成。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">fg(参数)</code></pre>
<h3 id="参数">参数</h3>
<p>作业标识:指定要放到前台的作业标识号。</p>
<h3 id="实例">实例</h3>
<p>使用fg命令将任务号为1的任务从后台执行转换到前台执行输入如下命令</p>
<pre><code class="language-bash">fg 1 #将任务转换到前台执行</code></pre>
<p>执行上面的命令后,命令行窗口将显示如下信息:</p>
<pre><code class="language-bash">find / -name password #前台执行命令</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->