home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeLinux in a NutshellSearch this book

7.8. Job Control

Job control lets you place foreground jobs in the background, bring background jobs to the foreground, or suspend (temporarily stop) running jobs. Job control is enabled by default. Once disabled, it can be reenabled by any of the following commands:

bash -m -i
set -m
set -o monitor

Many job control commands take jobID as an argument. This argument can be specified as follows:


Job number n


Job whose command line starts with string s


Job whose command line contains string s


Current job


Current job (same as preceding)


Previous job

bash provides the following job control commands. For more information on these commands, see Section 7.7, "Built-in Commands" earlier in this chapter.


Put a job in the background.


Put a job in the foreground.


List active jobs.


Terminate a job.


Suspend a background job.

stty tostop

Stop background jobs if they try to send output to the terminal.


Wait for background jobs to finish.


Suspend a foreground job. Then use bg or fg to restart it in the background or foreground. (Your terminal may use something other than Ctrl-Z as the suspend character.)

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.