Running Jobs in the Foreground with fg

Code Listing 9.8. Typing fg plus the job number brings that job into the foreground. When you bring suspended jobs into the foreground, you’ll sometimes see the job activities onscreen. At other times, you’ll see only a prompt and will need to summon help to see anything of the program.
[ejr@hobbes ejr]$ jobs
[1]+  Stopped   ftp ftp.cdrom.com
[ejr@hobbes ejr]$ fg %1
ftp ftp.cdrom.com

When you’re ready to resume a suspended or backgrounded 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.8), so you can see, for example, what it’s doing or provide input.

To Run Jobs in the Foreground ...

Get Unix Third Edition: 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.