fg ( English foreground ) - the command to resume the task and transfer control to it in command shells compatible with the POSIX standard. The command allows you to resume a suspended process or to bring it out of the background. It is usually implemented not as a utility, but as a command built into the command shell, because it works with tasks launched within the command shell. [one]
The command is implemented in such shells as bourne shell (sh) [2] and bourne again shell (bash) [3] .
Usage Example
Most often, the command is used to display all background and paused tasks:
fg
In order to “wake up” the process, you should pass the task number as a parameter to the command:
fg % jobspec
where jobspec is the serial number of the task.
See also
- bg - resume the task in the background.
Notes
- ↑ fg . pubs.opengroup.org. Date of treatment March 6, 2016.
- ↑ sh . www.freebsd.org. Date of treatment March 6, 2016.
- ↑ bash (1) - Linux manual page . man7.org. Date of treatment March 6, 2016.