March 2002
Beginner
504 pages
10h 47m
English
You can start processes in the foreground and background, suspend them, and move them between the foreground and background, but how do you know which commands are running? There are two commands to help you find out—jobs and ps.
The jobs command shows you the processes that are suspended and the ones running in the background. Because jobs runs as a foreground process, it cannot show you active foreground processes. In the following example, you have three jobs—the first one (job 3) is running, the second (job 2) is suspended (a foreground process after Ctrl+Z was issued), and the third one (job 1) is stopped in the background waiting for keyboard input:
$ jobs [3] + Running first_one & [2] - Stopped (SIGTSTP) ...
Read now
Unlock full access