Professional Documents
Culture Documents
RH124 - ch08s03 - 5
RH124 - ch08s03 - 5
pipeline is
displayed.
All pipeline processes are members of that job.
[1] 5998
Use the jobs command to display the list of jobs for the shell's session.
[user@host ~]$
[user@host ~]$ fg %1
sleep 10000
In the preceding example, the sleep command is running in the foreground on the controlling terminal.
The
shell itself is asleep and waiting for this child process to exit.
To send a foreground process to the background, press the keyboard-generated suspend request (Ctrl+z) in
the terminal.
The job is placed in the background and suspended.
^Z
[user@host ~]$
In the next example, the sleep command is currently suspended and the process state is T.
[user@host ~]$ ps j
PPID PID PGID SID TTY TPGID STAT UID TIME COMMAND
2768 5947 5947 2768 pts/0 6377 T 1000 0:00 sleep 10000
Use the bg command with the job ID to start running the suspended process.
[user@host ~]$ bg %1
The shell warns a user who attempts to exit a terminal window (session) with suspended jobs.
If the user tries
again to exit immediately, then the suspended jobs are killed.
Note
In the previous examples, the + sign indicates that this job is the current default.
If a job-control
command is used without %jobNumber argument, then the action is taken on the default job.
The -
sign indicates the previous job that will become the default job when the current default job
finishes.
References
Bash info page (The GNU Bash Reference Manual) https://www.gnu.org/software/bash/manual
Previous Next