You made it to the last lesson! You started at Zero, explored inside Linux, and now you're ready to be a Hero. ๐
๐ The mission: a system report
Your mission is to write one script that reports the most important facts about your own computer, using commands you already know.
Step 1: plan
| What to show | Command you learned |
|---|---|
| Computer name | hostname |
| Operating system | cat /etc/os-release |
| Kernel version | uname -r |
| How long it's been awake | uptime -p |
| CPU cores | nproc |
| Memory | free -h |
| Disk space | df -h / |
| Busiest programs | ps aux --sort=-%cpu |
Step 2: write the script
cd ~/MagiLab
nano sysreport.sh
Type this carefully:
#!/bin/bash
# Magi's System Report
echo "=== System report for $(hostname) ==="
echo "Made on: $(date)"
echo
echo "Operating system: $(. /etc/os-release && echo $PRETTY_NAME)"
echo "Kernel: $(uname -r)"
echo "Awake for: $(uptime -p)"
echo "CPU cores: $(nproc)"
echo
echo "--- Memory ---"
free -h
echo
echo "--- Disk (main drive) ---"
df -h /
echo
echo "--- The 3 busiest programs ---"
ps aux --sort=-%cpu | head -4
Save (Ctrl + O, Enter) and exit (Ctrl + X).
Step 3: make it runnable and run it
chmod +x sysreport.sh
./sysreport.sh
Step 4: save it to a file
./sysreport.sh > report.txt
cat report.txt
ls -l report.txt
๐ You wrote a real program that asks the OS for facts about the hardware and the processes, and writes them to a file: almost every idea in this course in one script!
Your four hero quests
๐ Quest 1: the process detective
Run top. Which are the three busiest programs? Which one uses the most memory? (Press M, then P.)
๐๏ธ Quest 2: the folder architect
Build a project tree three levels deep with mkdir -p, add four files, and show it with ls -R.
๐ Quest 3: the safety star
Make one file private with chmod 600, and prove it with ls -l. Then teach a family member one safe habit.
๐ Quest 4: the boot storyteller
Run systemd-analyze and uptime -p. Explain the boot story to a friend using the restaurant idea.
Teach it back
The best way to be sure you understand something is to teach it. Explain "What is an operating system?" to a friend in one minute, with no big words.
What's next?
- ๐ Try Raspberry Pi OS on a Raspberry Pi and explore a real Linux computer.
- ๐ Learn a programming language like Python to write bigger programs.
- ๐ Find out how computers talk to each other in a network.
- ๐ Learn how passwords and encryption keep secrets safe.
The Final Exam
Ten questions from the whole course. Get 8 or more right to earn your Operating System Hero badge. ๐

