Occasionally, you may have multiple jobs running or suspended and need a quick update about the jobs’ status. Using jobs, you can find out whether a job is running, stopped, or waiting for input, as shown in Code Listing 9.6.
[ejr@hobbes ejr]$ jobs
[1]- Running ftp calvin.raycomm.com &
[2]+ Stopped (tty input) telnet
[3] Stopped (signal) lynx
→ http://www.raycomm.com/
[ejr@hobbes ejr]$
|
jobs
At the shell prompt, type jobs. You’ll see a list of the current jobs(that is, processes that you’ve suspended or otherwise controlled) either running or stopped, as shown in Code Listing 9.6. Using the job numbers on the left, you can choose to run the jobs in the background or foreground, to resume them, or to kill the jobs, as described in the next few sections in this chapter.
✓ Tip
Depending on your shell, you can often kill jobs with kill followed by a % and the job number or command name—for example, you could kill the ftp job in Code Listing 9.6 with kill %ftp or kill %1. See Deleting Processes with kill later in this chapter for more on killing jobs.