Suspending jobs

Suppose you've just started a job that requires no input from you—say, downloading multiple files with ftp—and you suddenly realize that you've got to finish something else right now. Instead of waiting for the stinkin' files to download or stopping the job completely, you can, instead, just suspend the job and resume it later (Code Listing 9.4). In doing so, you can make the UNIX system work your way—that is, you don't lose the progress you've made toward getting the job done, and you can do the other stuff you need to do as well.

To suspend a job:



  • While the job is running, press these keys to suspend the process (Code Listing 9.4). doesn't actually terminate the process; it pauses the job in much the same way that pressing the Pause button on your CD player pauses the CD.

Code Listing 9.4. Suspending jobs is just like pushing the Pause button on your CD player.
[ejr@hobbes ejr]$ ftp calvin.raycomm.com
Connected to calvin.raycomm.com.
220 calvin Microsoft FTP Service (Version 2.0).
Name (calvin.raycomm.com:ejr): anonymous
331 Anonymous access allowed, send identity (e-mail name) as password.
Password:
230 Anonymous user logged in.
Remote system type is Windows_NT.
ftp>
[1]+ Stopped                  ftp calvin.raycomm.com
[ejr@hobbes ejr]$

Tip

After you've suspended a job, you can restart it in the background using bg, restart it in the foreground using fg, check on its status using jobs, or delete it completely using kill. Refer to the appropriate sections in this chapter for details on using these commands.


Tip

You can suspend as many jobs at a time as you want. Just use to do so, then use jobs to check the status of each suspended job if you need to.


Tip

Because it's pretty easy to forget that you've suspended a job, most shells will remind you that "there are stopped jobs" when you try to log out of the system. You'll need to either resume the job or kill it before you can log out. Yes, the UNIX system uses the terms "stopped jobs" and "suspended jobs" more or less interchangeably.


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

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