[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.
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 into the foreground (Code Listing 9.8). 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 and be able to enter information as prompted. Other times, you’ll just see the prompt for the program you returned to the foreground. If this is the case, try typing ? (for help), which often forces the program to display something onscreen and refresh the display. |
✓ Tip
You can bring the last suspended job into the foreground by typing fg (with no job number) at the shell prompt.