01 Introduction to Operating Systems
Before Linux, understand the job every operating system does.
A computer is just electronics โ a processor (CPU) that does maths, memory (RAM) that holds work-in-progress, and storage (disk) that keeps files. On its own, that hardware doesn't know how to open a photo or run a browser.
Hardware vs Software
๐ฉ Hardware
The physical parts you can touch โ CPU, RAM, disk, keyboard, network card.
๐พ Software
Instructions that tell hardware what to do โ the OS itself, plus apps like a browser or editor.
What an operating system is responsible for
โ๏ธ Process management
Starts, pauses and stops running programs, and shares the CPU between them.
๐ง Memory management
Gives each program the RAM it needs and protects programs from each other.
๐ File-system management
Organises data into files and folders on disk and controls access to them.
๐จ๏ธ Device management
Talks to hardware (disks, GPUs, printers) through drivers.
๐ Network management
Sends and receives data over the network so machines can talk.
๐ Security & users
Decides who may do what โ logins, permissions, isolation.
The three you'll meet most
| OS | Best known for | Under the hood |
|---|---|---|
| Windows | Desktops, gaming, office work | Closed-source, made by Microsoft |
| macOS | Apple laptops & creative work | Built on a UNIX foundation |
| Linux | Servers, cloud, AI, phones (Android) | Open-source โ anyone can read & improve it |
02 History of Linux
Where it came from โ and why that story still shapes how Linux works.
Linux didn't appear out of nowhere. It's the latest chapter in a 50-year story that began with UNIX at Bell Labs.
| pipe) instead of one giant program. You'll feel this everywhere.Why Linux succeeded
- Free & open source โ no licence fees; the code is public.
- A global community โ thousands of contributors fix and improve it daily.
- It runs anywhere โ from a $5 sensor to the world's fastest supercomputers.
03 Why Learn Linux?
The payoff โ before we touch a single command.
What makes Linux special
Where Linux actually runs
โ๏ธ Cloud
The vast majority of cloud servers run Linux.
๐ค AI servers
GPU training & inference happen on Linux.
๐ Web servers
Most of the internet is served from Linux.
๐ฆพ Supercomputers
All of the world's top 500 run Linux.
๐ฑ Android
Every Android phone runs a Linux kernel.
๐ก IoT & embedded
Routers, cameras, cars, smart devices.
๐ฆ Data centres
Banks, exchanges and telecoms.
๐ก๏ธ Cybersecurity
Pen-testing & defence tooling.
04 Linux Architecture
The four layers โ from your app down to the metal.
๐ค User space
Where your apps and the shell live. If a program here crashes, the system keeps running.
๐ก๏ธ Kernel space
Privileged core code that talks directly to hardware. Protected from ordinary programs.
๐ System calls
The โfront deskโ โ how a program in user space politely asks the kernel to do something (open a file, use the network).
๐ Device drivers
Kernel modules that know how to speak to a specific piece of hardware.
05 The Linux File System
One tree to rule them all โ starting at /.
/dev/sda), running processes, even system settings. Learn to navigate files and you can control the whole system.Unlike Windows (with C:, D: drives), Linux has a single tree that starts at the root directory /. Everything hangs off it.
/home is where your stuff lives, /etc is where settings live, and /var/log is where you look when something breaks.06 The Building Blocks of Linux
The handful of core ideas the system is made of.
Everything you'll do in Linux is really about managing these abstractions:
๐ Files
Named chunks of data.
๐ Directories
Folders that hold files.
โ๏ธ Processes
Programs that are running.
๐งต Threads
Smaller units of work inside a process.
๐ค Users
Accounts that own things.
๐ฅ Groups
Users bundled for shared access.
๐ Permissions
Who can read/write/run what.
๐ Devices
Hardware exposed as files in /dev.
๐ Network interfaces
Connections to other machines.
๐ Services
Background programs (daemons).
๐ Shell
Your command interpreter.
๐ฑ Environment variables
Settings passed to programs.
07 Users and Login
Linux was multi-user from day one.
Many people (or programs) can use one Linux machine at once, each kept separate. There are two kinds of accounts you must know:
๐ง Normal user
Everyday account (e.g. student). Can only touch its own files. Safe.
๐ root (superuser)
The all-powerful admin. Can change anything โ including break everything. Use with care.
sudo in front of a single command. Never โliveโ as root.Ways to log in
- Console login โ typing your username & password at the machine itself.
- SSH โ logging into a remote machine securely over the network (how you reach cloud servers):
ssh student@server-ip # connect to a remote Linux machine08 The Shell & Terminal
The single most important skill in this whole guide.
๐ฅ๏ธ Terminal
The window you type into โ a text screen for talking to the computer.
๐ Shell
The program inside that window that reads your commands and runs them. The most common one is Bash. (Zsh is a popular modern alternative.)
Reading a command
ls -l /home/student # โโฌโ โโฌโ โโโโโโโโฌโโโโโโโ # command option argument
A command has three parts: the command (what to do), options (how to do it, usually starting with -), and arguments (what to do it to).
09 Essential Commands TRY THEM BELOW โ
The everyday vocabulary of the command line.
๐งญ Navigation
pwd where am I ยท ls list ยท cd change dir ยท tree show as tree
๐ Files
touch create ยท cp copy ยท mv move/rename ยท rm remove ยท mkdir/rmdir folders
๐ Viewing
cat whole file ยท less/more page through ยท head/tail top/bottom
๐ Searching
find by name ยท locate fast find ยท grep search inside files ยท which locate a command
๐ฝ Disk
df free space ยท du folder size ยท lsblk drives ยท mount attach storage
โน๏ธ System & help
uname ยท hostname ยท date ยท whoami ยท id ยท man & --help
man ls to read it, or ls --help for a quick summary. You never need to memorise everything.๐ฉ Interactive Linux terminal โ try it yourself
This is a safe, simulated Linux shell running in your browser. Nothing here can harm anything. Type a command and press Enter. Start with help, then try ls, pwd, cd Documents, cat notes.txt, whoami.
10 File Permissions
The heart of Linux security โ who can do what.
Every file and folder answers three questions for three groups of people. The questions are Read (r), Write (w), and Execute (x). The people are the Owner, the Group, and Others.
-rwxr-xr-- 1 student staff # what ls -l shows you
โโโฌโโโฌโโโฌโ
โ โ โ โ others: r-- (read only)
โ โ โโโโ group: r-x (read + execute)
โ โโโโโโโ owner: rwx (read + write + execute)
โโโโโโโโโ type: - (- = file, d = directory)| Letter | On a file | On a folder |
|---|---|---|
r read | view its contents | list what's inside |
w write | change it | add/remove files in it |
x execute | run it as a program | enter it (cd into it) |
๐งฎ chmod calculator โ click the boxes
Permissions are often written as a 3-digit number. Toggle what each group can do and watch the number build:
| Read (4) | Write (2) | Exec (1) | |
|---|---|---|---|
| Owner | |||
| Group | |||
| Others |
Commands
| Command | What it does |
|---|---|
chmod 755 file | Set permissions (owner rwx, others r-x) |
chmod +x script.sh | Make a file executable |
chown student file | Change the owner |
chgrp staff file | Change the group |
755 = programs & folders (everyone can use, only you can change) ยท 644 = normal files (you edit, others read) ยท 600 = private (only you).11 Process Management
Everything running is a process โ here's how to watch and control them.
A process is a running program. Each has a unique number (PID). Processes can start other processes (a parent starting a child). Some run in the foreground (you wait for them); others in the background (they run while you keep working).
| Command | What it does |
|---|---|
ps aux | List all running processes |
top / htop | Live, updating view of CPU & memory use |
kill 1234 | Politely stop the process with PID 1234 |
kill -9 1234 | Force-stop (last resort) |
killall firefox | Stop every process by name |
jobs ยท bg ยท fg | Manage background/foreground jobs |
htop (or top) to see, at a glance, what's using your CPU and memory โ the first thing an engineer checks when a machine is slow.12 Installing Software
No hunting for โ.exeโ files โ Linux uses package managers.
A package manager installs, updates and removes software for you from trusted online repositories โ handling dependencies automatically. Which one you use depends on the distribution family:
๐ Debian / Ubuntu
sudo apt update # refresh the catalog sudo apt install git # install a package sudo apt upgrade # update everything
๐ด RedHat / Fedora / Rocky
sudo dnf install git # (older: yum)
sudo dnf update13 Networking Basics
How your machine finds and talks to others.
๐ข IP address
A machine's number on the network, like 192.168.1.20.
๐ท๏ธ Hostname
A friendly name for a machine, like web-server.
๐ DNS
The โphone bookโ that turns names (google.com) into IP addresses.
๐ช Ports
Numbered doors on a machine โ web = 80/443, SSH = 22.
๐ SSH
Secure remote login over the network.
๐ Localhost
127.0.0.1 โ the machine talking to itself.
| Command | What it does |
|---|---|
ip a | Show this machine's IP addresses |
ping google.com | Check if another host is reachable |
curl / wget | Fetch data / download files from the web |
ss -tulpn | See which ports are open (modern netstat) |
14 Services (systemd)
The background programs that keep a server running.
A service (or daemon) is a program that runs quietly in the background โ a web server, a database, your monitoring script. On modern Linux, the manager in charge of starting and supervising them is systemd. It's also the first thing that runs when Linux boots.
| Command | What it does |
|---|---|
systemctl status nginx | Is the service running? show details |
sudo systemctl start / stop nginx | Start or stop it now |
sudo systemctl enable nginx | Start it automatically at boot |
journalctl -u nginx | Read that service's logs |
systemctl status tells you if it failed; journalctl -u <service> tells you why. This pair solves most server problems.15 Text Editors
You'll edit config files constantly โ pick an editor.
๐ผ nano
Beginner-friendly. Shortcuts shown at the bottom. Start here. Save = Ctrl+O, exit = Ctrl+X.
โก vi / vim
Everywhere, powerful, but modal. Worth learning because it's on every server.
๐งฐ Others
Once comfortable: VS Code (remote), emacs, micro.
Surviving vi โ the one thing beginners must know
vi has modes. This trips everyone up once:
| Toโฆ | Do this |
|---|---|
| Type text | Press i (insert mode) |
| Stop typing | Press Esc (back to command mode) |
| Save & quit | Type :wq then Enter |
| Quit without saving | Type :q! then Enter |
:q! to leave without saving. You're welcome.16 Shell Scripting
Turn commands you repeat into a reusable program.
A shell script is just a text file full of commands. It's how you automate โ backups, deployments, health checks. Scripts understand variables, conditions, loops and functions.
#!/bin/bash # greet.sh โ a first script name="$1" # $1 = first argument if [ -z "$name" ]; then name="world" fi for i in 1 2 3; do echo "($i) Hello, $name โ welcome to Linux!" done
chmod +x greet.sh # make it runnable ./greet.sh Ada # run it with an argument
if) make decisions ยท loops (for/while) repeat work ยท functions group steps ยท arguments ($1 $2) pass input in.17 Environment Variables
Little settings the whole system reads.
Environment variables are named values available to your shell and the programs it runs. A few you'll meet constantly:
| Variable | Holds |
|---|---|
PATH | The list of folders searched when you type a command |
HOME | Your home directory (/home/student) |
USER | Your username |
SHELL | Which shell you're using |
echo $HOME # show one variable printenv # show them all export EDITOR=nano # set one for this session
ls, the shell searches every folder in PATH to find that program. โcommand not foundโ usually means it isn't on your PATH.18 Linux Administration
Keeping a real system healthy.
๐ค Users & groups
useradd, passwd, usermod, groupadd
๐ฝ Disk management
df, du, lsblk, mount
๐ Log files
Live in /var/log; read with tail -f & journalctl
โฐ Cron jobs
Schedule tasks with crontab -e
๐พ Backups
tar, rsync for copies & archives
๐ Monitoring
top, htop, free, uptime
# run a backup every day at 2am (crontab -e)
0 2 * * * tar -czf /backup/home.tgz /home/student19 Linux Security
A few habits that keep systems safe.
๐ Least privilege
Use a normal account; reach for sudo only when needed. Never browse or code as root.
๐ SSH keys
Prefer key-based login over passwords; disable root SSH login.
๐งฑ Firewall
Open only the ports you need: sudo ufw allow 22, then sudo ufw enable.
๐ Permissions
Keep private files at 600; don't chmod 777 to โfixโ problems.
๐ Updates
Patch regularly โ most breaches exploit known, unpatched bugs.
๐ Logs
Watch /var/log/auth.log for suspicious logins.
chmod 777 gives everyone full control of a file โ a classic security hole. And sudo rm -rf / tries to delete the entire system. Treat both as red buttons.20 Linux in Modern Computing
Where this foundation takes you next.
Every powerful technology below runs on Linux. The commands you just learned โ files, permissions, processes, services, networking โ are exactly what these tools use under the hood.
๐ Python
The language of automation & AI.
๐ Git
Version control for all your code.
๐ณ Docker
Package apps into portable containers โ built directly on Linux features.
โธ๏ธ Kubernetes
Run & scale containers across many machines.
๐ธ๏ธ Distributed systems
Many Linux machines working as one.
โ๏ธ Cloud
AWS, Azure, GCP โ Linux everywhere.
๐ค AI servers
GPU training & inference on Linux.
๐ฅ๏ธ HPC clusters
Supercomputing for research.
๐ฐ๏ธ Edge / DevOps
Automation & on-device inference.
โ Knowledge Check
Quick questions โ click an answer to see if you've got it.
chmod 600 secret.txt meanโฆ21 Hands-on Labs
Reading isn't enough โ do these on a real (or virtual) Linux box.
- 01Create your first directory structure and navigate it with absolute & relative paths.
- 02Create, copy, move and delete files with
touch,cp,mv,rm. - 03Edit a file with
nano(then tryvi) and save it. - 04Add a new user and group; set a password.
- 05Watch CPU & memory live with
htop. - 06Install a package with
apt(ordnf). - 07Connect to another machine with
ssh. - 08Write and run your first Bash script.
- 09Schedule a daily backup with
cron. - 10Break & fix: stop a service, then diagnose it with
systemctl&journalctl.
โ Your Learning Roadmap
Each step stands on the one before it โ that's the whole idea.
๐ Mini Glossary
Plain-English definitions for the words that come up most.
Kernel
Shell
Distribution (โdistroโ)
root / sudo
Process
ps and top show them.