2019-03-31 09:05:09 +00:00
|
|
|
.. _cmd-fg:
|
|
|
|
|
2018-12-17 01:39:33 +00:00
|
|
|
fg - bring job to foreground
|
2019-01-03 04:10:47 +00:00
|
|
|
============================
|
2018-12-17 01:39:33 +00:00
|
|
|
|
2018-12-18 01:58:24 +00:00
|
|
|
Synopsis
|
|
|
|
--------
|
2018-12-16 21:08:41 +00:00
|
|
|
|
2021-12-17 23:16:47 +00:00
|
|
|
``fg`` [*PID*]
|
2018-12-16 21:08:41 +00:00
|
|
|
|
2018-12-19 02:44:30 +00:00
|
|
|
Description
|
2019-01-03 04:10:47 +00:00
|
|
|
-----------
|
2018-12-16 21:08:41 +00:00
|
|
|
|
2021-12-17 21:58:38 +00: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-16 21:08:41 +00:00
|
|
|
|
2021-12-17 23:16:47 +00:00
|
|
|
For compatibility with other shells, job expansion syntax is supported for ``fg``. A *PID* of the format **%1** will foreground job 1.
|
2021-12-17 21:58:38 +00:00
|
|
|
Job numbers can be seen in the output of :ref:`jobs <cmd-jobs>`.
|
2018-12-16 21:08:41 +00:00
|
|
|
|
2018-12-19 02:44:30 +00:00
|
|
|
Example
|
2019-01-03 04:10:47 +00:00
|
|
|
-------
|
2018-12-16 21:08:41 +00:00
|
|
|
|
2018-12-19 20:02:45 +00:00
|
|
|
``fg`` will put the last job in the foreground.
|
2021-02-28 12:56:23 +00:00
|
|
|
|
|
|
|
``fg %3`` will put job 3 into the foreground.
|