Learn › Linux Foundations › Job Control
jobs - a hands-on Linux lab on a real virtual machine.
The Job Control module capstone mission. Drill the & background operator, jobs, Ctrl-Z, bg, fg, and nohup in one hands-on operation on a real Linux VM. Mission mode: no commands shown, recall required.
You have finished the Job Control module. Seven moves are yours now. An ampersand at the end of a line sends a job to the background and hands your prompt back. Ctrl-Z freezes a job running in front of you. jobs reads the table of what you have running or parked. bg wakes a frozen job into the background, fg pulls a job to the front, and nohup keeps a job alive after you log out.
This is the final run. One real machine, six objectives, and every one of them uses a move you already trained. Nothing new is introduced here.
This is mission mode. No commands are shown. You read the objective, recall the move, and type it. That recall is the whole point: it is how these six moves become instinct. Progress checks itself as you go, and a signal is one click away if you get stuck.
One quick rep in the practice terminal before the real machine boots. Same rules as the mission: the goal is stated, the command is not. If this comes back instantly, you are ready.
You want to start a job that waits five seconds, but you refuse to let it freeze your terminal. Send it to the background so your prompt comes back the instant you press Enter, and let it count down out of sight. The shell will answer with a job number in brackets and a process ID.
prompt: student@linuxcamp:~$ answer: sleep 5 & output: [1] 12345 hint: Take the waiting command and add the one character that backgrounds it, at the very end: the waiting word, the number of seconds, then the ampersand.
That line is this machine's, captured at one moment. The [1] will be the same for you, because it is the first background job in a fresh shell, but the 12345 is a PID the system picked this once. Yours will read differently, and that is expected.
That move came from memory, not from a copy button. Good. The mission asks for that same recall five more times. You will launch a job in the background, read the job table, freeze a running job and park it, wake it into the background, pull one to the front, and leave a job running past logout.
Boot the machine below and take the console. Six objectives, no commands shown, progress checks itself as you type.
Practice Operation Night Shift in a real Linux terminal at The Linux Camp. Progress is verified automatically as you type commands on the machine.