Skip to main content

Lab 4.4 - Background Jobs and Tasks

Objectives​

  • Launch processes in the background
  • Manage jobs with jobs, fg, bg
  • Use nohup for persistent processes

Exercise 1: Jobs​

# Launch in the background
sleep 100 &
sleep 200 &

# View jobs
jobs
jobs -l

# Bring to the foreground
fg %1

# Send to the background
bg %1

Exercise 2: nohup​

# Process that continues after logout
nohup sleep 600 > sleep.log 2>&1 &

# Verify
ps aux | grep sleep

Lab created on: December 2024 - Tested on Ubuntu 24.04