2019-03-31 17:05:09 +08:00
|
|
|
.. _cmd-fg:
|
|
|
|
|
2018-12-17 09:39:33 +08:00
|
|
|
fg - bring job to foreground
|
2019-01-03 12:10:47 +08:00
|
|
|
============================
|
2018-12-17 09:39:33 +08:00
|
|
|
|
2018-12-18 09:58:24 +08:00
|
|
|
Synopsis
|
|
|
|
--------
|
2018-12-17 05:08:41 +08:00
|
|
|
|
2021-12-18 05:58:38 +08:00
|
|
|
**fg** [*PID*]
|
2018-12-17 05:08:41 +08:00
|
|
|
|
2018-12-19 10:44:30 +08:00
|
|
|
Description
|
2019-01-03 12:10:47 +08:00
|
|
|
-----------
|
2018-12-17 05:08:41 +08:00
|
|
|
|
2021-12-18 05:58:38 +08:00
|
|
|
The **fg** builtin brings the specified :ref:`job <syntax-job-control>` to the foreground, resuming it if it is stopped.
|
|
|
|
While a foreground job is executed, fish is suspended.
|
|
|
|
If no job is specified, the last job to be used is put in the foreground.
|
|
|
|
If ``PID`` is specified, the job containing a process with the specified process ID is put in the foreground.
|
2018-12-17 05:08:41 +08:00
|
|
|
|
2021-12-18 05:58:38 +08:00
|
|
|
For compatibility with other shells, job expansion syntax is supported for ``fg``. A ``PID`` of the format ``%1`` will foreground job 1.
|
|
|
|
Job numbers can be seen in the output of :ref:`jobs <cmd-jobs>`.
|
2018-12-17 05:08:41 +08:00
|
|
|
|
2018-12-19 10:44:30 +08:00
|
|
|
Example
|
2019-01-03 12:10:47 +08:00
|
|
|
-------
|
2018-12-17 05:08:41 +08:00
|
|
|
|
2018-12-20 04:02:45 +08:00
|
|
|
``fg`` will put the last job in the foreground.
|
2021-02-28 20:56:23 +08:00
|
|
|
|
|
|
|
``fg %3`` will put job 3 into the foreground.
|