Complete these before leaving the lab. Real Ubuntu 22.04 system required.
1
Use process substitution to diff the output of getent passwd against /etc/passwd. Explain any differences you see.
2
Start a long-running command (e.g., sleep 300), suspend it with Ctrl+Z, send it to background with bg, verify with jobs, then disown it. Verify it survives shell exit with ps aux | grep sleep.
3
Write a pipeline that finds the top 5 users by number of processes currently running. Use ps, awk, sort, and uniq.
4
Create a tmux session named lab with two windows: one running htop, one with a shell. Detach, close the terminal, reattach, and verify both windows are intact.
5
Write a script using set -euo pipefail, trap for cleanup, and an array of at least 3 items. The script should process each item and write results to a temp file that is cleaned up on exit.
6
Extension: Write a parallel SSH runner that checks uptime on at least 2 hosts simultaneously using background jobs and wait. Time it with time and compare to sequential execution.