2018-11-16 07:48:05 +00:00
|
|
|
---
|
|
|
|
layout: page
|
|
|
|
category-page: intermediate
|
|
|
|
category-title: Intermediate commands
|
|
|
|
tags: stopped job fg foreground
|
|
|
|
author: Fabiano Fenini
|
|
|
|
title: fg
|
2018-11-18 20:38:56 +00:00
|
|
|
previous-page: pages/cmd/interm/curl.html
|
|
|
|
next-page: pages/cmd/interm/git.html
|
2018-11-16 07:48:05 +00:00
|
|
|
---
|
2018-11-16 08:12:40 +00:00
|
|
|
The <code>fg</code> command allows us to continue a stopped operation by running it
|
|
|
|
in foreground.<br>
|
2018-11-16 07:48:05 +00:00
|
|
|
|
|
|
|
The command name stands for <i>foreground</i>.<br><br>
|
|
|
|
|
|
|
|
<h3>Usage</h3>
|
|
|
|
|
|
|
|
The default fg command syntax is:
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
fg [%job_number]
|
|
|
|
</pre>
|
|
|
|
|
2018-11-16 08:12:40 +00:00
|
|
|
The parameter [%job_id] contains the job number you wish to run in foreground.
|
|
|
|
If this is not indicated, the command will run the last stopped operation.<br><br>
|
|
|
|
|
|
|
|
<h3>Stop a working job</h3>
|
|
|
|
|
|
|
|
To stop the execution of a command so that i can be later resumed with <code>fg</code>
|
|
|
|
you need to press the <code>ctrl + Z</code> keys. The job number to be used with the
|
|
|
|
<code>fg</code> command will be printed.
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
top
|
|
|
|
^Z
|
|
|
|
[1] + NNNN suspended top
|
|
|
|
</pre>
|