Mission 4 of 5
Process Management
Identify and stop only a practice process you started.
View processes, start harmless background jobs, and stop only the jobs you created.
Mental model
Understand what is happening
A process is a running program.
PID means process ID.
Kill only processes you understand.
Guided lab
Work through the mission
View processes
Shows current and system processes.
ps
ps aux | head -15
pgrep -l bashCreate and stop a practice job
Starts one harmless background process, captures its exact PID with $!, then stops and waits for that same process. This remains deterministic even when other jobs already exist.
cd ~/linux-practice
sleep 100 &
practice_pid=$!
echo "Started practice PID: $practice_pid"
jobs -l
kill "$practice_pid"
wait "$practice_pid" 2>/dev/null || true
jobs -lBroad process killing examples
Useful but broad. Prefer job number or exact PID while learning.
killall sleep
pkill -f 'sleep 200'Checkpoint
Verify the mission
The practice process disappears while unrelated processes remain.
Try it yourself
One step without a recipe
Start one sleep job, list it, stop it, and confirm it is gone.
Need a hint?
When something hangs, don't reach for `kill -9` first. Try plain `kill` — it sends a polite 'please stop' signal (SIGTERM). Most well-written programs will shut down cleanly. `kill -9` is the sledgehammer. It works, but it skips cleanup and can leave temp files or locked resources behind. Save it for when polite doesn't work.
Explain it back
Before you move on
- What is a PID?
- Why should you avoid broad pkill patterns as a beginner?