Mission 24 of 30
System Monitoring and Performance
Collect a small health report from memory, processes, uptime, and logs.
Observe memory, uptime, processes, logs, and repeated command output.
Practice inside
~/linux-practice. Check your setup before you begin.
Prerequisite: Basic Networking Commands
.
What you’ll practice
- Inspect memory and uptime
- Sort processes
- Use watch and stop it
The mental model
- Monitoring is usually read-only.
- top, watch, and less-like tools have exit keys.
- Ctrl+C stops watch.
Try it in your terminal
Memory and uptime
Read-only system viewShows memory, uptime, and short virtual memory stats.
Run from ~/linux-practice
free -h
uptime
vmstat 1 2 Process snapshots
Read-only system viewShows a non-interactive top snapshot and memory-heavy processes.
Run from ~/linux-practice
top -b -n 1 | head -20
ps aux --sort=-%mem | head -10 Logs and watch
Read-only system viewReads recent logs only when systemd is running, then starts a repeating clock. This handles non-systemd distributions and WSL environments where systemd is disabled. Stop watch with Ctrl+C.
Run from ~/linux-practice
if command -v journalctl >/dev/null && [ "$(ps -p 1 -o comm=)" = systemd ]; then
journalctl -n 20 --no-pager
else
echo "systemd journal is not available in this environment"
fi
watch -n 2 date Put it into practice
- Use ps to find the top memory process.
- Run watch date and stop it with Ctrl+C.
Check your result
The report captures a readable snapshot without changing the system.
Common mistakes
- You start `watch` and stare at a screen that won't respond to your typing. watch runs until you stop it. Press Ctrl+C. Same with top — press q to quit. If you don't know the exit key, you're trapped in the tool.
- You see a warning in `journalctl` and panic. A warning is evidence to investigate, not a complete diagnosis. Read nearby messages and confirm the affected service before acting.
Check your understanding
Explain these in your own words. If you’re unsure, revisit the examples before moving on.
- How do you stop watch?
- Which command shows memory usage?
Your practice, your pace
Loading saved progress…