Checking Job Status with jobs

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.

Code Listing 9.6. Viewing jobs lets you know which jobs you have suspended and their status.
[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]$

To Check Job Status with jobs:

  • 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.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.240.178