What is Linux
Why DevOps runs on Linux, and why 99% of servers run it too.
You SSH into a server in the cloud, run docker exec into a container, or
kubectl exec into a Pod, and almost every time you end up inside Linux.
In this lesson we'll work out what a kernel and a distribution are, and
learn to tell what system you're on with two commands.
Why a DevOps engineer needs Linux
Almost all server software lives on Linux: databases, web servers, queues, CI agents, Kubernetes nodes. The containers you'll work with in this course are Linux containers too. They need a Linux kernel, which is why on macOS and Windows Docker Desktop runs them inside a small Linux virtual machine.
You can see this for yourself. On a Mac, uname -s prints Darwin,
that's the macOS kernel. But Docker on that same Mac will tell you it's
running on a Linux kernel:
docker info --format '{{.OperatingSystem}} {{.KernelVersion}}'
Docker Desktop 5.15.49-linuxkit
The number 5.15.49-linuxkit is the version of the Linux kernel inside
the Docker Desktop virtual machine. Yours will be different.
Kernel and distribution
- Kernel — the program that manages hardware, memory, processes, file systems, and networking. Strictly speaking, Linux is the kernel itself.
- Distribution — a kernel plus a set of programs around it: a shell,
basic utilities (
ls,cp,grep), a package manager, an init system, and conventions for where files live.
Ubuntu, Debian, Alpine, and Rocky Linux all use the same Linux kernel (in different versions). What makes them different is what they put around that kernel.
Distributions you'll run into most often as a DevOps engineer:
| Distribution | Package manager | Where you'll see it |
|---|---|---|
| Ubuntu, Debian | apt | cloud virtual machines, base Docker images |
| Alpine | apk | small Docker images |
| Rocky Linux, AlmaLinux, RHEL | dnf (yum on older versions) | enterprise servers |
| Arch | pacman | rare on servers, more common on developers' own machines |
How to find out where you are
You need two commands. The first, uname, asks the kernel:
uname -a
Linux web-01 6.8.0-31-generic #31-Ubuntu SMP ... x86_64 GNU/Linux
This is an example from a server running Ubuntu, with the middle of the
line cut. Left to right: kernel name Linux, hostname web-01,
kernel version 6.8.0-31-generic, kernel build, CPU architecture
x86_64, OS name. You can get each field on its own:
| Command | What it prints | Example |
|---|---|---|
uname -s | kernel name | Linux, Darwin on a Mac |
uname -r | kernel version | 6.8.0-31-generic |
uname -m | architecture | x86_64, aarch64 (ARM; a Mac on Apple Silicon itself prints arm64) |
uname -n | hostname | web-01 |
uname doesn't know the distribution: the kernel doesn't care what
programs sit around it. The distribution is reported by the
/etc/os-release file:
cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.5 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
...
The main fields: ID (a short distribution name, handy for scripts),
VERSION_ID (the version), and PRETTY_NAME (a human-readable name).
ID_LIKE points to its relatives: Ubuntu is built on Debian, so their
packages and commands largely overlap.
Container and kernel
A container doesn't carry its own kernel. Inside a container there are
only the distribution's files, and its processes run on the host's
kernel. That's why on one machine, containers running Ubuntu and Alpine
will show the same version from uname -r, while /etc/os-release will
differ. You'll check this yourself in the second lab.
The basic commands are almost the same
In this course we rely on what works on any Linux: POSIX shell, basic utilities, shared system concepts. Differences between distributions show up most often in three places:
- Packages. Each has its own package manager and its own package names.
- Init system. Ubuntu, Debian, and the RHEL family use systemd. Alpine on a virtual machine uses OpenRC, and containers usually have no init system at all.
- Utilities on Alpine. Instead of GNU coreutils, it has BusyBox: one
program pretending to be
ls,cp,grep, and dozens of other commands. The main flags are the same, but there are fewer rare ones. For example,ls --versionon Ubuntu printsls (GNU coreutils) 9.4, while on Alpine it answersls: unrecognized option: version.
Common mistakes
- Identifying a distribution by the hostname or by
uname. The hostname is set by whoever administers the machine, it can be anything.uname -aon Ubuntu may contain the wordUbuntuin the build string, but that's the kernel build, not the distribution. In a container, the kernel build comes from the host entirely. Check/etc/os-release. - Expecting a container to have its own kernel version. A container
from the
ubuntu:24.04image on a host with kernel 5.15 will show 5.15, not the kernel that normally ships with Ubuntu 24.04. - Running
apton Alpine orapkon Ubuntu. You'll getnot found. First checkIDin/etc/os-release, then pick the package manager from the table above. - Treating macOS as "basically Linux". The terminal looks similar, but
the kernel is different (
Darwin), there's no/etc/os-releasefile, and many BSD-derived utilities behave differently. For this course's hands-on work on a Mac, you need Linux in a container or a virtual machine.
What you'll need for the tasks
uname -s,uname -r,uname -m: kernel name, kernel version, architecture.cat /etc/os-release: which distribution, theIDandVERSION_IDfields.- The table of distributions and package managers from this lesson.
- Docker for the second lab: the lab environment starts with one script, the commands for getting into the container are in the lab's README. Docker itself is covered in the docker-basics track.
In the next lesson we'll look at the file system: what lives where, and why.
Done reading?
Mark the lesson as read to move your track progress forward.
Lesson marked as done.
Go through it with an AI agent
The agent explains anything unclear in plain words and walks you through 2 labs for this lesson. This track is free.
Tell the agent: use MCP izi, give me lesson linux-basics-01-what-is-linux
Progress saved in this browser
Clear your history or open this on your phone, and the marks will be gone. Leave your email and they'll move to your account. No password needed.
Done. moved to your account. You can see your progress on any device. My progress