Many people can share one computer. So the OS needs to know who is who, and what each person is allowed to do. Linux does this very clearly, and you can see it. ๐
๐งช Lab 1: who are you?
whoami
id
groups
idshows your user ID, your main group, and every group you are in.- Groups help the OS give a whole team the same permissions.
who
This lists the people logged in right now.
๐งช Lab 2: read a permission line
cd ~/MagiLab
touch diary.txt
ls -l diary.txt
You'll see a line like this:
-rw-r--r-- 1 magi magi 0 Nov 10 08:30 diary.txt
Break it down:
| Part | Meaning |
|---|---|
- |
A normal file (d would mean a folder) |
rw- |
The owner may read and write |
r-- |
The group may only read |
r-- |
Everyone else may only read |
magi magi |
The owner's name and the group's name |
The letters mean: r = read (look), w = write (change), x = execute (run).
๐ Your line might look a little different. On Ubuntu, new files often start as
-rw-rw-r--, which means the group may write too. On Raspberry Pi OS they usually start as-rw-r--r--. Both are fine, because the idea is the same.
๐งช Lab 3: lock your diary
Right now, anyone can read your diary. Let's make it private:
echo "Dear diary, Linux is awesome!" > diary.txt
chmod 600 diary.txt
ls -l diary.txt
Now it shows -rw-------: only you can read and write it! The numbers are a shortcut: 6 = rw-, 0 = ---.
| Number | Letters | Meaning |
|---|---|---|
| 7 | rwx |
read, write and run |
| 6 | rw- |
read and write |
| 4 | r-- |
read only |
| 0 | --- |
nothing |
Try a read-only diary:
chmod 400 diary.txt
echo "one more line" >> diary.txt
You'll get Permission denied, even though it's your own file! Permissions protect you from your own mistakes, too. Put the permission back:
chmod 600 diary.txt
echo "one more line" >> diary.txt
cat diary.txt
๐งช Lab 4: scripts need permission to run
Remember chmod +x? Look at your script:
ls -l hello.sh
You'll see an x in the line: it has execute permission. Without it, ./hello.sh would say Permission denied.
๐งช Lab 5: meet sudo (with a grown-up)
Try reading the file that stores secrets:
ls -l /etc/shadow
cat /etc/shadow
Permission denied, because only root (the all-powerful administrator) may read it. sudo means "do this as the super user". A grown-up can do a harmless test:
sudo whoami
It says root. Never use sudo on commands you don't understand, and never run a command that combines sudo with rm -r. It can erase a whole computer.
๐ Standard user vs administrator: it's safest to work as a standard user, and only borrow admin powers with
sudowhen a grown-up says so.
๐งช Lab 6: updates (look, don't touch)
apt list --upgradable 2>/dev/null | head
This shows which programs have updates waiting. Updates fix bugs and security holes that bad programs try to sneak through. A grown-up can apply them with sudo apt update and sudo apt upgrade.
Stay safe: the hero habits
- ๐ Strong passwords. Long, mixed, like Purple-Rocket-Pizza-42! Never share them.
- ๐ Install updates.
- ๐ค Think before you click. Tricky messages that pretend to be someone else are called phishing.
- ๐ Lock your screen when you walk away.
- ๐พ Back up the files you love.
๐ก๏ธ The OS is the guard, but you are the hero who makes smart choices.
Words to know
| Word | What it means |
|---|---|
| Permission | A rule about who can read, change or run a file |
| Root | The all-powerful administrator account |
| sudo | Borrow root powers for one command |
| Phishing | A trick message that tries to fool you into giving away secrets |


