Job Control
Explore how to manage jobs in Bash by running commands in the background, controlling them using foreground and background commands, sending signals, and waiting for processes to complete. This lesson helps you master job specifications, signals, and key built-ins like fg, bg, and wait to effectively control Bash jobs.
We'll cover the following...
How Important is this Lesson?
Job control is a core feature of bash, and considered a central concept to understand if you are using bash every day.
Starting Jobs
You’re going to look at running a simple job using the sleep command.
Type this in:
You typed a ‘normal’ command (sleep 60) and then added in another character,
the ampersand (&). The ampersand will run the command ‘in the background’, which
becomes a job in this bash session.
The job has two identifiers, which are immediately reported to you in the terminal.
[1] 39165
The first is the job number, which in this case is 1, and the second is the
process identifier, in this case 39165, but this will be different for you.
If, before the time is up, you run any other commands:
then they are not interfered ...