Linux is a free and open source operating system. Strictly speaking, it is the kernel Linus Torvalds created in 1991: the central program that manages the hardware, the memory and the processes. In everyday use, "Linux" means a complete system put together by a distribution (Ubuntu, Debian, RHEL), which adds the libraries, tools and applications around the kernel.
This guide gives you the essential vocabulary and landmarks to work on a Linux server: how the system is organised in layers, how its filesystem (the way files are laid out on disk) is structured, and how it boots. It is the groundwork of the Fundamentals part of the course: these notions come back in every guide of the section.
What you will learn
By the end of this guide, you will be able to:
- explain in what sense Linux is a kernel and what distributions add around it,
- describe how a simple command such as
lstravels from the user layers down to the kernel, - name the 7 boot stages of a modern Linux server, from UEFI to systemd,
- find your way around the
/tree without hesitating over where a configuration file, a log or a script belongs.
What is Linux?
The Linux kernel is distributed under the GPL licence (a free licence: anyone may study, modify and redistribute the code). It is what manages the hardware, the memory, the processes and the files.
In everyday use, people say "Linux" to mean a complete system. That system is actually provided by a distribution, which bundles:
- the Linux kernel,
- system libraries (including the libc),
- GNU utilities and other tools,
- an init system (most often systemd),
- a package manager (APT, DNF, APK…),
- and additional applications.
Common distributions in server administration: Ubuntu Server, Debian, RHEL/Rocky Linux, Alpine Linux.
The package manager depends on the distribution family: apt on Debian and Ubuntu, dnf on RHEL and its derivatives AlmaLinux and Rocky Linux, apk on Alpine.
This split of roles explains the name GNU/Linux some people use. Linus Torvalds wrote the kernel; Richard Stallman and the GNU project provided most of the tools around it: compiler, shell and utilities. A distribution combines both, and much more, into a system you can actually use.
The components of a Linux system
A Linux system is not a single block but a stack of bricks, each one resting on the ones below it. The table below lists these bricks, starting from the hardware. Above all, remember the Role column: when something breaks, it tells you which brick to question. A service that will not start belongs to init. A command that is not found comes from a typo or a missing package: in the second case, the package manager installs it.
| Component | Role | Example |
|---|---|---|
| Kernel | Manages hardware, memory, processes | Linux 6.12 (Debian 13), Linux 7.0 (Ubuntu 26.04) |
| Libraries | Interface between programs and the kernel | glibc, musl |
| Shell | Interprets commands | bash, zsh, sh |
| System tools | Handle files, networking, processes | coreutils, util-linux |
| Package manager | Installation and updates | apt, dnf, apk |
| Init / PID 1 | Starts and supervises services (first process of the system) | systemd |
Everything that runs on top of the kernel (libraries, shell, system tools, applications) forms the user space, also called userland. The kernel itself is not part of it.
How is a Linux system built?
Rather than a list of abstract layers, let's start from a concrete example.
You type ls /etc in a terminal:
- The shell (bash, zsh…) parses the line and locates the
lsprogram. - The shell starts
lsas a new process (a program being run). lscalls functions of the C library (glibc) to read the directory.- The libc turns these calls into system calls, requests addressed to the kernel (
openat,getdents64…). - The kernel receives these calls, queries the filesystem, and reads the entries on disk.
- The kernel hands the entries back to
ls, which writes them to the terminal itself.
The diagram below shows the first five steps, from the typed line to the disk. Step 6 is not drawn there: the data the kernel read goes back to ls through the C library, and ls writes it straight to the terminal, without going back through the shell. Look at the "system call" arrow: it crosses the border between user space, where your programs run, and the kernel.
This path illustrates the fundamental rule: the shell is not Linux. It is an ordinary user program. Linux is the kernel that arbitrates access to resources.
Because it is an ordinary program, several shells exist, and they do not all accept the same syntax. The commands of this course are written for bash, the default shell of Debian, Ubuntu and RHEL. zsh accepts most of them, with a few differences. fish, the default on some distributions such as CachyOS, is not compatible with bash syntax: it writes set name value where bash writes name=value, and it closes its loops with end instead of do … done.
To find out which shell you are using, type echo $SHELL: the command prints your login shell.
echo $SHELL# /bin/bash on Debian, Ubuntu or RHEL# /usr/bin/fish on a distribution that chose fishIf the printed path does not end with bash, type bash to open a bash shell for the exercises, then exit to return to yours. In that bash shell, echo $SHELL still prints your login shell, not bash: this is expected, the test did not fail.
Kernel mode and user mode
Linux constantly separates two zones:
- Kernel mode: the kernel runs with full access to the hardware. A bug here can freeze the whole system.
- User mode: all your processes (shell, services, applications) run with restricted privileges. A crash in this space does not bring the kernel down, except that of PID 1, whose death triggers a kernel panic.
A program asks the kernel for something only through a system call: it is the mandatory crossing point between the two modes, and the central protection mechanism of the Linux architecture.
Four confusions to clear up right away
These four shortcuts come up with people who are just starting out, and each one leads to a specific diagnostic mistake. Clearing them up now saves you from looking in the wrong place when something breaks.
- Linux is not a distribution: Debian, Ubuntu and RHEL are distributions, and Linux is the kernel they ship.
- The shell is not the terminal: the terminal displays and forwards your keystrokes, the shell interprets the line.
/procand/sysare not real data directories: they are virtual views of the kernel, computed when you read them./tmpis not durable storage: never assume its content survives a reboot. Data that must last is written to a persistent location, such as/varor a home directory under/home, never to/tmpor/run.
How does a Linux server boot?
On a modern Linux server, booting follows a precise sequence of 7 stages. Knowing it lets you diagnose a server that will not boot, or understand why a service does not start.
The diagram below puts the seven stages in order, from the power button to the services. Look at the two stages with a thick outline, the initramfs and the services: they are where you will most often have to step in. A driver or a volume that cannot be found blocks the server at the initramfs, before the real system is even mounted. A failed service shows up at the last stage, when the rest of the system has started.
-
Firmware (BIOS / UEFI)
At power-on, the firmware (the motherboard's program: BIOS, or UEFI on recent machines) initialises the hardware (CPU, RAM, disks, network cards), then hands over to a boot loader. On a UEFI system with Secure Boot turned on, the checks form a chain of trust: the firmware verifies the signature of the first loader (most often shim, signed in a way the firmware recognises), then shim or GRUB verifies that of the kernel. A modified link is refused before it runs.
-
Boot loader (GRUB2 / systemd-boot)
The boot loader displays a menu, lets you pick one kernel among those installed, or pass parameters. It loads two things into memory: the compressed Linux kernel (vmlinuz) and an initramfs image.
Installing a kernel does not make it run. A machine can host several kernels at the same time, and the one that runs is not necessarily the newest. You will type these three commands yourself after the lesson on the terminal; for now, read what their outputs reveal. They compare what is installed with what is running.
lslists the kernel files of/boot,readlinkprints the target of a symbolic link (a file that is only a shortcut to another location), anduname -rgives the version of the kernel currently running:Terminal window ls /boot/vmlinuz*readlink /boot/vmlinuzuname -rHere is the result on a freshly installed Ubuntu 26.04. Only one kernel is installed,
/boot/vmlinuzpoints to it, anduname -ranswers the same version. Thevmlinuz.oldlink already exists and, for now, points to the same file. The first three lines come fromls, the fourth fromreadlinkand the last fromuname -r:Output (Ubuntu 26.04, kernel 7.0.0-43-generic) /boot/vmlinuz/boot/vmlinuz-7.0.0-43-generic/boot/vmlinuz.oldvmlinuz-7.0.0-43-generic7.0.0-43-genericOn Ubuntu, after a kernel update, two versions coexist in
/boot:vmlinuzpoints to the newest andvmlinuz.oldto the previous one. As long as the machine has not rebooted,uname -rstill answers the previous version. These links are not universal: on Debian 13 and on AlmaLinux 10.2, tested the same way,readlink /boot/vmlinuzreturns nothing andlslists only thevmlinuz-file followed by the version. Compareuname -rwith thevmlinuz-*files of/bootinstead. In every case,/proc/cmdlineconfirms which one actually booted. The-ooption ofgrepprints only the part of the line that matches the pattern, hereBOOT_IMAGE=followed by the characters up to the first space:Terminal window grep -o 'BOOT_IMAGE=[^ ]*' /proc/cmdlineOutput (Ubuntu 26.04, kernel 7.0.0-43-generic) BOOT_IMAGE=/boot/vmlinuz-7.0.0-43-genericThe file named by
BOOT_IMAGEis the one that runs. When it differs from the newest kernel present in/boot, an installed kernel is not running yet, for lack of a reboot. This explains why a kernel security update has no effect until the machine reboots, unless the fix is applied live (livepatch), and why compliance tools distinguish "patched" from "rebooted". -
Kernel decompression and initialisation
The kernel decompresses itself, detects the available hardware and takes control of the CPU. It does not mount the real root of the system yet.
-
Initramfs / initrd
The initramfs (Initial RAM Filesystem) is a compressed archive loaded into memory. It contains a minimal environment, drivers, scripts and tools, that lets the kernel:
- load the drivers it needs: RAID (several disks combined into one), LVM (logical volumes, flexibly carved out of the disks) or encryption,
- find and prepare the real root partition,
- decrypt the volume if needed.
The kernel starts the first program of this archive,
/init, which becomes PID 1 (the first process of the system). This is the stage people often forget, but it is critical: without an initramfs, the kernel would generally not know how to reach an LVM or encrypted disk. -
Switch-root to the real root
Once the real
/partition is reachable, the initramfs program performs a switch-root: it leaves the initramfs environment and switches to the real filesystem installed on disk. -
PID 1, systemd (or another init)
After the switch-root, PID 1 becomes the init of the real root: the process number does not change, the program does. On Debian, Ubuntu, RHEL and their derivatives, it is systemd (Alpine Linux uses OpenRC). It manages everything that follows.
-
Services and the default target
systemd reads its units, the files that describe each service or group of services (
.service,.target,.socket…), and starts the services while honouring their dependencies. The default target (multi-user.targeton a server without a graphical interface) decides which set of services is active once boot is complete.
Knowing this sequence pays off mostly on the day it stops. A failure at the initramfs stage and a failed service at the systemd stage are not handled in the same place. Knowing which of the 7 stages failed lets you target the diagnosis instead of guessing.
What is the Linux filesystem hierarchy (FHS)?
Linux organises all its data in a single tree, defined by the Filesystem Hierarchy Standard (FHS). Everything starts from the root /. These are the main directories to know:
Répertoire/ (root, starting point of the whole tree)
Répertoireetc/ configuration files for the system and services
- …
Répertoirevar/ persistent variable data (logs, service state…)
- …
Répertoireusr/ programs, libraries and documentation
- …
Répertoirehome/ users' home directories
- …
Répertoireboot/ kernel, initramfs, boot loader
- …
Répertoiretmp/ temporary files, do not assume they persist
- …
Répertoirerun/ volatile runtime data (reset at boot)
- …
Répertoireproc/ virtual view of the kernel and processes
- …
Répertoiredev/ representation of the devices
- …
Remember three reflexes first; they cover most of the daily searches on a server:
- looking for a configuration starts in
/etc/; - analysing a problem starts in
/var/log/; - finding a runtime file starts in
/run/: the PID file that holds the number of a running process, or the socket, the contact point through which two programs talk to each other.
The FHS directory tree guide then details each area, with the differences between distributions and the commands to check them. It is meant to be read after the guides on shells and commands, once these landmarks are in place. To continue the course, first open Open a terminal and understand the prompt: you will type your first commands there.
Put it into practice
These landmarks stick by practising, not by rereading the guide. Do the lab after the lesson Open a terminal and understand the prompt, where typing commands is taught: the scenario does not give them, but the lab hints supply each one, at the cost of a few points. The lab prepares a separate working folder on your machine, with a file to fill in. You run the commands on your own machine to find the kernel version, the distribution identifier, one file in /etc and one file in /var/log, then write these four values into the file. The validation compares them with the real state of your system: an invented value fails.
Key points
- Linux, strictly speaking, is a kernel. A distribution combines this kernel with libraries, tools and an init system into a usable system.
- The shell is an ordinary user program. A program asks the kernel for something only through a system call.
- A modern boot goes: firmware → boot loader → kernel → initramfs → switch-root → PID 1 / systemd → services.
- The initramfs prepares the real root before the switch-root, which matters most on LVM, RAID or an encrypted volume.
- Installing a kernel does not make it run:
uname -randBOOT_IMAGEin/proc/cmdlinetell you which one is running, and only a reboot activates an updated kernel. - The FHS defines a standard tree:
/etcfor configuration,/varfor variable data,/usrfor programs,/bootfor booting. The FHS directory tree guide details each area.
Knowledge check
Check that the essentials of this guide stuck. The questions cover only what has just been explained here.
Knowledge check
Check what you have learned with this interactive quiz
How it works
- The timer starts when you click Start
- Multiple choice, true/false and short answer questions
- You can move between questions
- Detailed results are shown at the end
Starts the quiz and the timer
Review
(0/0)Result saved on this device. It will be sent to your account at the next sync. Sync now
Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
Continue the course: Choose a Linux server distribution
A new full quiz with random questions
Work again only on the questions you missed
FAQ: frequently asked questions
These questions come up often when people discover Linux: what a distribution is, what the kernel does, how the system boots, what processes, services, users and files are.
Definition
- Originally: only the kernel
- Today: the whole system (kernel + GNU tools)
Key characteristics
- Free: the source code is open to everyone
- Multi-user and multitasking
- Portable: runs on servers, PCs, phones, embedded devices
- Secure: fine-grained permission management
Where it runs
- Servers and containers
- Android (built on the Linux kernel)
- Supercomputers
A layered architecture
| Component | Role |
|---|---|
| Kernel | Manages hardware, memory, processes |
| Shell | Command-line interface (Bash, Zsh) |
| CLI tools | System commands (ls, cp, grep...) |
| Applications | User software |
The kernel
uname -r # Show the kernel version
It manages processes, memory, devices, filesystems and networking.The shell
- Bash: the most widespread
- Zsh: modern, advanced completion
- Fish: beginner-friendly
What it contains
- The Linux kernel
- GNU utilities
- A package manager (
apt,dnf,pacman) - An init system (
systemd) - A graphical interface (optional)
Popular distributions
| Distro | Use | Package manager |
|---|---|---|
| Ubuntu | Desktop/Server | apt |
| Debian | Stable server | apt |
| RHEL/Rocky | Enterprise | dnf |
| Arch | Advanced users | pacman |
| Alpine | Containers | apk |
Choosing a distribution
- Beginner: Ubuntu, Linux Mint
- Server: Debian, Rocky Linux
- DevOps: Ubuntu Server, Alpine
A layered model
┌─────────────────────────┐
│ Programs │ User mode
│ (shell, ls, services…) │
├─────────────────────────┤
│ Libraries (libc) │
├─────────────────────────┤
│ System calls (API) │
├─────────────────────────┤
│ Linux kernel │ Kernel mode
├─────────────────────────┤
│ Hardware │
└─────────────────────────┘
Two execution modes
- Kernel mode: full access to the hardware (privileged)
- User mode: restricted access (safe)
How they talk
Programs use system calls (syscalls) to request services from the kernel. The shell is one of these programs: it startsls, but ls makes its own system calls:strace ls # Trace the system calls
The boot sequence
- BIOS/UEFI: hardware initialisation, POST
- Boot loader (GRUB):
/etc/default/grub # Configuration
/boot/grub/grub.cfg # Generated file
- Linux kernel: decompression, hardware detection
- Initramfs: loads the drivers it needs and prepares the real root
- Switch-root: switches to the real root
- systemd (PID 1):
systemctl list-units --type=target
- Services: systemd starts them up to the default target (
multi-user.targetorgraphical.target)
Troubleshooting
dmesg | less # Kernel messages
journalctl -b # Logs of the current boot
systemd-analyze blame # Boot time per unit
Key concepts
- PID: unique process identifier
- PPID: PID of the parent process
- States: Running, Sleeping, Stopped, Zombie
Essential commands
# List the processes
ps aux # Every process
ps -ef --forest # Process tree
# Real-time monitoring
top # Classic view
htop # Improved view
# Managing processes
kill PID # Signal SIGTERM
kill -9 PID # Signal SIGKILL (force)
killall nginx # By name
# Priority
nice -n 10 command # Start with a low priority
renice -n 5 -p PID # Change the priority
Background processes
command & # Run in the background
jobs # List the jobs
fg %1 # Bring back to the foreground
systemd: the modern service manager
systemctl is the main command:# Status of a service
systemctl status nginx
# Start / Stop
systemctl start nginx
systemctl stop nginx
systemctl restart nginx
systemctl reload nginx # Reload the configuration
# Enable at boot
systemctl enable nginx
systemctl disable nginx
# List the services
systemctl list-units --type=service
systemctl list-units --failed
Unit files
/etc/systemd/system/ # Custom units (take precedence)
/lib/systemd/system/ # Shipped by packages
systemctl daemon-reload # Reload after a change
Logs
journalctl -u nginx # Logs of one service
journalctl -f # Follow in real time
Types of users
- root (UID 0): superuser, every right
- System users (UID 1-999): services
- Regular users (UID 1000+): humans
Management commands
# Create a user
sudo useradd -m -s /bin/bash jean
sudo passwd jean
# Modify
sudo usermod -aG docker jean # Add to a group
sudo usermod -l newname oldname
# Remove
sudo userdel -r jean # -r removes the home directory
# Groups
sudo groupadd devops
sudo gpasswd -a jean devops
Key files
| File | Contents |
|---|---|
/etc/passwd |
User accounts |
/etc/shadow |
Passwords (hashed) |
/etc/group |
Groups |
sudo
sudo command # Run as root
sudo -u user command # Run as another user
visudo # Edit /etc/sudoers
The standard hierarchy (FHS)
/
├── bin/ → Essential binaries
├── boot/ → Boot files
├── dev/ → Devices
├── etc/ → System configuration
├── home/ → User home directories
├── lib/ → Shared libraries
├── opt/ → Optional software
├── proc/ → Process information (virtual)
├── root/ → root's home
├── tmp/ → Temporary files
├── usr/ → User programs
└── var/ → Variable data (logs)
Permissions
ls -la file
# -rwxr-xr-- user group file
# ^^^ ^^^ ^^^
# | | └── Others (r--)
# | └────── Group (r-x)
# └────────── Owner (rwx)
chmod 755 file # rwxr-xr-x
chmod u+x script.sh # Add execute permission
chown user:group file # Change the owner
Filesystem types
- ext4: the Linux standard
- XFS: high performance
- Btrfs: snapshots, compression