DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Controlling processes

Background jobs and job numbers

You can run a process in the background, so that while it executes you can get on with something else, by appending an ampersand (&) to the command line, as follows:

   $ vi tobermory &
   [1]     13560
In this case, ``1'' is the job number and ``13560'' the process ID. Unlike PIDs, job numbers are allocated by the currently running shell, not by the operating system. While PIDs are assigned to all currently active processes, job numbers represent only active background processes, and while PIDs are unique across the system, job numbers are not.

Compound commands (where processes are linked using the semi-colon) should be grouped using parentheses, as follows:

   $ (sleep 20; date > /dev/tty06) &
   [1]     25143
   $ jobs
   [1] +  Running                 (sleep 20; date > /dev/tty06)&

Next topic: Waiting for background jobs to finish before proceeding
Previous topic: Finding out what processes are running

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003