โ† Operating System Basics: From Zero to Hero
Level 1 ยท Zero: Getting Started

Build Your Linux Lab

Lesson 2 of 14 ยท โฑ 12 min

Welcome to the lab! ๐Ÿงช Here is where you get your very own Linux to explore. You only need to do this once.

Pick your Linux lab

There are several ways to get Linux. Pick the one that fits you. Ask a grown-up to help with the setup.

Ways to get a Linux lab: a Raspberry Pi, Ubuntu on a computer, a virtual machine, WSL on Windows, or a browser terminal.

Lab Best for Notes
๐Ÿ“ Raspberry Pi with Raspberry Pi OS The best real-hardware lab A tiny computer that runs Linux. You can really see inside it.
๐Ÿงช Virtual machine (Linux inside a window) The safest sandbox Free programs like VirtualBox (PC) or UTM (Mac) run Ubuntu in a window. Break it? Just reset it!
๐Ÿ’ป Ubuntu on a computer A full Linux desktop Use a spare laptop, or "Try Ubuntu" from a USB stick without installing.
๐ŸชŸ WSL on Windows A quick Linux terminal on Windows A grown-up runs wsl --install in PowerShell.
๐ŸŒ A Linux terminal in your browser Trying it in 30 seconds Search for "online Linux terminal". It's fun to try, but some commands won't work.

๐ŸŽ On a Mac? The Mac Terminal is very similar to Linux, and many commands work the same. But some labs show things only Linux has (like /proc and free). A virtual machine or a Raspberry Pi will match the lessons exactly.

All the labs in this course are written for Ubuntu and Raspberry Pi OS. If your Linux is different, most commands still work.

The lab rules ๐Ÿฅฝ

Real scientists keep their lab safe. These rules keep you and your computer safe:

  1. ๐Ÿงช Work in your practice folder. Make and delete things only inside ~/MagiLab, the folder you'll create below.
  2. ๐Ÿค” Only type commands you understand. If you aren't sure, ask a grown-up.
  3. ๐Ÿ‘ช Ask a grown-up before sudo. It gives super powers. We will meet it later.
  4. ๐Ÿšซ Never copy a command from a stranger or a random website.
  5. ๐Ÿ›‘ If something looks scary, stop and ask. Nothing here is urgent.

Open the terminal

The terminal is a window where you type commands to the OS. Open it:

  • Ubuntu desktop: press Ctrl + Alt + T, or search for Terminal.
  • Raspberry Pi OS: click the black Terminal icon in the top bar.
  • WSL or a virtual machine: open the Ubuntu or Terminal app.

You'll see a line that ends with $. That's the prompt, and it means "I'm ready for your command!"

Anatomy of a terminal line: user name, computer name, current folder, the dollar sign prompt, the command and its argument.

๐Ÿงช Lab 1: your first commands

Type each command, then press Enter.

whoami

It tells you your user name. That's who the OS thinks you are.

hostname

This is the name of the computer.

pwd

Print working directory: where am I? You'll see something like /home/magi. That's your home folder.

date
echo "Hello, Linux!"

date shows the date and time. echo makes the computer say whatever you type.

cat /etc/os-release

This reads a file that every Linux has, with its name and version. Look for the line PRETTY_NAME=. That's your operating system's full name.

uname -a

uname shows facts about the kernel, the heart of Linux. Look for the version number, like 6.8.0.

๐Ÿงช Lab 2: make your practice folder

mkdir ~/MagiLab
cd ~/MagiLab
pwd
  • mkdir makes a new folder. The ~ is a short way to write your home folder.
  • cd means change directory: you walked into the new folder.
  • pwd should now show /home/yourname/MagiLab.

Three tricks that save you time โšก

Trick What it does
โ†‘ (up arrow) Brings back the last command you typed
Tab key Finishes a name for you. Type cat /etc/os-r then press Tab
Ctrl + C Stops a command that is running. This is your emergency brake!

Also: clear tidies the screen, and man ls opens the manual for ls (press q to leave).

Your first cheat sheet

Command Meaning
whoami Who am I?
hostname What's this computer called?
pwd Where am I?
ls What's in this folder?
cd folder Go into a folder
mkdir name Make a folder
echo "hi" Say something
clear Tidy the screen
man command Open the manual

๐ŸŽฏ Quiz time!

1. What does the $ at the end of the prompt mean?
2. Which command shows the folder you are in right now?
3. What does Ctrl + C do?
4. Which of these is one of the lab rules?