In simple terms, a process is
a single executable program that is running in its own address
space. It is distinct from a job or a command, which, on Unix
systems, may be composed of many processes working together to perform a
specific task. Simple commands like
ls are executed as a single process. A
compound command containing pipes will execute one process per pipe
segment. For Unix systems, managing CPU resources must be done in large
part by controlling processes, because the resource allocation and batch
execution facilities available with other multitasking operating systems
are underdeveloped or missing.
Unix processes come in several types. We’ll look at the most common here.
Interactive processes are initiated from and controlled by a terminal session. Interactive processes may run either in the foreground or the background. Foreground processes remain attached to the terminal; the foreground process is the one with which the terminal communicates directly. For example, typing a Unix command and waiting for its output means running a foreground process.
While a foreground process is running, it alone can receive
direct input from the terminal. For example, if you run the
diff command on two very large files, you
will be unable to run another command until it finishes (or you kill
it with CTRL-C).
Job control allows a process to be moved between the foreground and the background at will. For example, when a process is moved from the foreground ...