Running jobs in the foreground with fg

When you're ready to resume a suspended job, you can do so using fg. Remember, when you suspend a job, what you're doing is moving the job into limbo. fg just moves the job into the foreground again (Code Listing 9.7), for example, so you can see what it's doing or provide input.

To run jobs in the foreground with fg:

1.
jobs
At the shell prompt, type jobs to list all stopped or running jobs. Note the job numbers at the left.
2.
fg 1
Enter fg followed by the number of the job that you want to bring back to the foreground (Code Listing 9.7). Depending on the job you're bringing back into the foreground, you may or may not get to see the job running onscreen. Sometimes you'll be plunked back into the job ...

Get Unix: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.