← Operating System Basics: From Zero to Hero
Level 1 Β· Zero: Getting Started

The Six Jobs of an OS: A Guided Tour

Lesson 4 of 14 · ⏱ 10 min

Every operating system does the same six big jobs. Today we'll be detectives and find proof of each job on your own Linux. πŸ•΅οΈ

A hub and spoke diagram with the OS in the middle and six jobs around it.

# 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.

🎯 Quiz time!

1. Which command lists the programs (processes) that are running?
2. What does it mean when cat /etc/shadow says Permission denied?
3. Where does Linux keep the files that represent devices?
4. What does the id command show?