Every operating system does the same six big jobs. Today we'll be detectives and find proof of each job on your own Linux. π΅οΈ
| # | Job | Detective clue |
|---|---|---|
| 1 | Run programs | ps |
| 2 | Share memory | free -h |
| 3 | Organize files | ls / |
| 4 | Talk to devices | ls /dev |
| 5 | Keep things safe | id and a locked file |
| 6 | Show a friendly screen | echo $SHELL |
π§ͺ Job 1: run programs π
ps
ps lists the processes (running programs) in your terminal. You'll see bash (the program that reads your commands) and ps itself! Now see everything running on the computer:
ps aux | head -8
Every line is one process, started and tracked by the OS.
π§ͺ Job 2: share memory π
free -h
The OS hands out the RAM desk to every process, and keeps track of how much is used.
π§ͺ Job 3: organize files ποΈ
ls /
Linux keeps every single file in one big tree that starts at / (called root). You'll see folders like home, etc, bin and dev. We'll explore them in a later lesson.
π§ͺ Job 4: talk to devices π
ls /dev | head -15
/dev holds a "file" for each device: drives, terminals and more. Linux treats devices like files, so programs can talk to them in a simple way. You'll see names like null, tty and random.
π§ͺ Job 5: keep things safe π
id
This shows who you are and which groups you belong to. The OS uses it to decide what you're allowed to do. Now try this, because it is a nice safe experiment:
cat /etc/shadow
You'll get Permission denied. π That's the OS protecting a file that stores secrets! Seeing that message is good news. Your computer is keeping things safe.
π§ͺ Job 6: show a friendly screen πΌοΈ
echo $SHELL
This shows the shell program that is listening to you right now (often /bin/bash). If you use the desktop, windows and icons are another kind of friendly screen. Both are interfaces the OS provides.
π§ͺ Lab 7: fill in your detective report
Use nano, the beginner-friendly text editor, or echo, to save your clues:
cd ~/MagiLab
echo "Job 1: I ran ps and saw my processes" > six-jobs.txt
echo "Job 2: free -h shows how much RAM is used" >> six-jobs.txt
echo "Job 5: cat /etc/shadow was denied, so the OS keeps secrets safe" >> six-jobs.txt
cat six-jobs.txt
What if a job was missing?
| If the OS stopped... | Then... |
|---|---|
| Running programs | Nothing could start |
| Sharing memory | Programs would crash into each other |
| Organizing files | You could never find your homework |
| Talking to devices | Your keyboard and screen wouldn't work |
| Keeping things safe | Anyone could read your files |
| Showing a friendly screen | You'd see only a blank wall of code |
πΊοΈ Where next? Each job gets its own lab in the next lessons.
