Skip to main content

Linux concept: kernel

20 July 2026

Every command you type, every file you open, every packet your machine sends starts the same way: your program asks a single piece of software for permission and help, and that software talks to the hardware on its behalf. Your programs never touch the disk, the memory chips, or the network card directly. One program stands between all of them and the bare metal, decides who gets what, and keeps thousands of processes from stepping on each other. That program is the kernel. It is the core of the operating system, the part that is really "Linux", and understanding it is understanding what a Linux machine actually is.

1. The Basics

The kernel is the central program of the operating system. It is the first real software the machine loads at boot, it stays in memory the entire time the computer is on, and it has complete control over the hardware. Everything else, from your shell to your web browser to a database server, is an ordinary program that runs on top of the kernel and asks the kernel whenever it needs to do anything real.

The reason for this design is protection. A modern CPU can run in two modes. In kernel mode a program may do anything: touch any memory, talk to any device, halt the processor. In user mode a program is fenced in: it can only use its own memory and must ask for everything else. The kernel runs in kernel mode. Every other program runs in user mode. This split is what stops one buggy application from crashing the whole machine or reading another program's private data.

So the kernel is best understood as a gatekeeper and a referee. When your program wants to read a file, it cannot open the disk itself; it asks the kernel, and the kernel checks your permissions, reads the right blocks, and hands back the data. When two programs both want the CPU, the kernel decides who runs and for how long. When a program asks for memory, the kernel finds it and keeps it separate from everyone else's.

The right mental model: the kernel is the one program that is allowed to talk to the hardware. Every other program on the system is a guest that must ask the kernel for anything real, and the kernel decides yes or no.

This article is about that core program: what it does, where the name comes from, how Linux came to be, how you inspect and tune your own kernel, and the surprising truth that almost everything your computer does is really a short request handed across the line into the kernel and back. The examples are verified against Linux kernel version 6.11.

1.1 Seeing Which Kernel You Run

You can ask your running kernel to identify itself with one command, uname (short for "unix name"). The most useful flag is -r (short for "release"):

$ uname -r
6.11.0-29-generic

$ cat /proc/version
Linux version 6.11.0-29-generic (buildd@lcy02-amd64-008) (gcc 13.3.0) #29 SMP PREEMPT_DYNAMIC ...

The first line is the kernel version you are running right now. The second, read from the special file /proc/version, adds who built it, with which compiler, and when. Notice you are reading the kernel by opening a file: that trick appears again and again below.

1.2 What the Kernel Actually Does

The kernel's job breaks down into a few big responsibilities. Every one of them is about sharing a limited resource safely between many programs at once:

JobWhat it manages
Process scheduling Which program runs on which CPU core, and for how long
Memory management Giving each process its own private memory and reclaiming it
Filesystems Turning raw disk blocks into files, directories, and permissions
Device drivers Talking to hardware: disks, network cards, keyboards, GPUs
Networking The TCP/IP stack that turns data into packets and back
System calls The doorway programs use to ask the kernel for all of the above

No single application could do these jobs for itself without being able to interfere with every other application. Centralising them in one trusted program is the whole idea of an operating-system kernel.

1.3 Kernel Space and User Space

You will meet two phrases constantly: kernel space and user space. They name the two worlds the mode split creates. Kernel space is where the kernel and its drivers run, with full hardware access. User space is where every normal program runs, fenced off and asking for help. The boundary between them is crossed millions of times a second, and crossing it is exactly what a system call is:

USER SPACE     your shell, editor, browser, servers   (limited)
                          |
                          |   system call  (a guarded doorway)
                          v
KERNEL SPACE   scheduler, memory, drivers, filesystems (full power)
                          |
                          v
HARDWARE       CPU, RAM, disks, network, devices

Keep this picture in mind. Almost everything in the rest of this article is either something happening in kernel space, or a way for you, standing in user space, to look across the line and see what the kernel is doing.

1.4 The Two Great Illusions: Scheduling and Virtual Memory

Two of the kernel's jobs are worth singling out, because together they create the illusion that every program has the machine to itself.

The first is scheduling. Your machine runs far more programs than it has CPU cores, yet each one behaves as if it runs without interruption. The kernel achieves this by context switching: it lets one process run for a few milliseconds, saves its exact state, and hands the core to the next, hundreds of times a second. A scheduler decides the order, balancing fairness against responsiveness, and you can nudge a process's share with its nice value, a priority that runs from -20 (greedy) to 19 (generous):

$ nice -n 10 ./backup.sh     # start a job at low priority (short for "niceness")
$ renice -n 5 -p 1234        # lower the priority of a process already running

The second is virtual memory. Every process is handed its own private, continuous view of memory and thinks it owns the whole machine. The kernel maps those virtual addresses onto real RAM in small chunks called pages, pushes pages it does not need out to swap on disk, and uses any spare RAM as a page cache so recently read files come back instantly. This is why free memory on a healthy Linux box looks alarmingly low: the kernel is deliberately spending it as cache.

$ grep -E 'Cached|SwapTotal' /proc/meminfo   # page cache and swap size
Cached:         14711040 kB
SwapTotal:       8388604 kB

Neither illusion is something you switch on; both are always running, for every process, maintained by the kernel millions of times a second. The vm.swappiness setting you will meet later is one small dial on this second illusion.

Back to top

2. Where the Name Comes From

The word kernel is an ordinary English word borrowed for a technical idea. A kernel is the soft, essential seed at the centre of a nut or fruit stone, the core inside the hard outer shell. Computer scientists picked it for exactly that image: the small, essential core of the operating system, sitting inside everything else.

The contrast that makes the name click is the shell. In Unix, the program you type commands into is called the shell, and the name is deliberate: it is the outer layer you touch, wrapped around the core you do not. The two words are a matched pair from the same picture of a nut.

        you type here
             |
       [ SHELL ]        the outer layer: bash, zsh, your programs
       [ kernel ]       the core inside: talks to the hardware
             |
         hardware

So the layout of a Unix system is written into its own vocabulary. You live and work in the shell, the outer layer. Underneath, doing the real work with the hardware, sits the kernel, the core. When people say a program "drops into the kernel", they mean your request has crossed from the shell world into that inner core.

The name Linux itself is narrower than people think. It is the name of the kernel alone, coined from its author's first name, Linus, plus the Unix-style ending. Strictly, "Linux" is only this one core program. The full operating system around it, the shell, the compilers, the everyday commands, comes largely from the GNU project, which is why uname -o answers GNU/Linux and not just "Linux".

Back to top

3. A Short History

The Linux kernel began as a student's side project and grew into the most widely deployed piece of software in the world. Knowing that story explains several of its design choices.

The background is Unix, written at AT&T's Bell Labs from 1969, and its idea of a small kernel plus many small tools. Unix was not free, so in the 1980s two efforts set out to build a free replacement. Richard Stallman started the GNU project in 1983 and built a full set of Unix tools, but its own kernel was not ready. Separately, Andrew Tanenbaum wrote Minix, a small teaching operating system, so students could study a real kernel's source.

In 1991 a Finnish student, Linus Torvalds, frustrated with Minix's licence, started writing his own kernel for fun. His announcement on 25 August 1991 is famous for how modest it was:

"I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones." The hobby became the kernel that now runs most of the internet, all 500 of the Top 500 supercomputers, and every Android phone.

Torvalds released the kernel under the GNU GPL, so anyone could read, change, and share it. Combined with the already-finished GNU tools, it made a complete free operating system. Thousands of developers joined, and it grew into the largest collaborative software project ever.

One early argument shaped how people think about the kernel. In 1992 Tanenbaum publicly called Linux's monolithic design obsolete, arguing for a microkernel instead. In a monolithic kernel, drivers and filesystems all run together in kernel space; in a microkernel, most of them run as separate user-space programs. Linux stayed monolithic, for speed and simplicity, but added loadable modules so it did not have to be one rigid block. That "monolithic but modular" choice is still the design today.

YearMilestone
1969 Unix begins at Bell Labs, setting the small-kernel-plus-tools pattern
1983 GNU project starts building a free Unix, but lacks a finished kernel
1991 Linus Torvalds announces the Linux kernel; version 0.01 follows in September
1994 Linux 1.0 is released, the first version considered production-ready
2011 Version jumps to 3.0 for the 20th anniversary, not for a big rewrite
Today The 6.x series runs on servers, phones, cars, routers, and supercomputers

The version numbers deserve a note, because they surprise people. Since the 3.0 jump, the first number does not mean a major rewrite; Torvalds raises it mostly when the second number grows uncomfortably large. A new stable kernel now comes out roughly every nine or ten weeks. The version you run, such as 6.11, is just a point on a steady, continuous line.

Not every release is meant to be kept, and the difference matters when you choose a kernel. Most versions are stable releases, maintained for only a couple of months. A few are marked Long-Term Support (LTS) and receive security fixes for several years; these are the ones distributions build on and almost every production server runs. Above them sits the mainline, where Torvalds merges new development. In practice you almost never chase the newest mainline kernel: you run the tested LTS kernel your distribution ships and let it feed you the security patches.

Back to top

4. Simple Use Cases

You rarely "use" the kernel directly, because every command already does. But there are a few everyday things you do ask about it by name, and they all start with reading, not changing.

4.1 Read Your Kernel Version in Full

The uname command has a flag for each piece of system information. The one that prints everything is -a (short for "all"):

$ uname -a
Linux xps 6.11.0-29-generic #29~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC ... x86_64 GNU/Linux

Read left to right, that line is the kernel name, the hostname, the release, the build version, the machine's CPU architecture, and the operating system. Each field also has its own flag if you want just one:

FlagShort forPrints
-s kernel name Linux
-r kernel release 6.11.0-29-generic
-v kernel version build string, date, and flags
-m machine x86_64, the CPU architecture
-o operating system GNU/Linux

4.2 See the Kernel File on Disk

The whole kernel is a single file in the /boot directory, named vmlinuz followed by the version. You can list it like any other file:

$ ls -lh /boot/vmlinuz*
-rw------- 1 root root 15M Jun 26  2025 /boot/vmlinuz-6.11.0-29-generic
-rw------- 1 root root 15M Jan 10  2025 /boot/vmlinuz-6.8.0-52-generic

Two facts stand out. First, the kernel that runs your entire machine is a single file of only about fifteen megabytes. Second, there is more than one. Your system keeps older kernels installed so you can boot an earlier one if a new version misbehaves; the boot menu lets you pick.

4.3 List the Kernels You Have Installed

Each installed kernel also has a directory of its modules under /lib/modules, named for its version. Listing that directory is the quickest way to see every kernel your system can boot:

$ ls /lib/modules
6.8.0-52-generic   6.11.0-28-generic   6.11.0-29-generic

The one you are running is whichever uname -r reports. The rest sit ready as fallbacks, which is why a kernel update never leaves you stranded: the previous, working kernel is still on disk and still in the boot menu.

Back to top

5. Moderate Use Cases

Once you can read the kernel, the next step is to watch it work and to see the parts it loads on demand. None of this changes anything; it is all inspection, and most of it needs no special rights.

5.1 Kernel Modules: The Parts That Load on Demand

A module is a piece of kernel code, most often a device driver, that can be loaded into the running kernel and unloaded again without a reboot. This is how one small kernel file supports thousands of different devices: it loads only the drivers your hardware actually needs. List the loaded ones with lsmod ("list modules"):

$ lsmod | head -4
Module                  Size  Used by
tls                   155648  0
inet_diag              28672  2 tcp_diag,udp_diag
udp_diag               12288  0

Each row is a driver or feature living inside your kernel right now. To learn what one is, ask modinfo:

$ modinfo tls
filename:       /lib/modules/6.11.0-29-generic/kernel/net/tls/tls.ko.zst
license:        Dual BSD/GPL
description:    Transport Layer Security Support

The .ko in the filename stands for "kernel object", the format a module takes on disk. On modern systems it is compressed, hence the extra .zst. Loading and unloading modules needs root and is done with modprobe, which also pulls in any modules the one you ask for depends on:

$ sudo modprobe -r tls     # remove a module (short for "remove")
$ sudo modprobe tls        # load it again, with its dependencies

5.2 Reading the Kernel Through /proc and /sys

You already read /proc/version above. That file is not really on any disk: it is part of procfs, a virtual filesystem the kernel invents in memory to expose its own state as ordinary files. Its companion, sysfs at /sys, does the same for devices and kernel objects. Together they are the reason so much of Linux is inspected by simply reading a file:

$ cat /proc/cpuinfo        # every CPU core the kernel sees
$ cat /proc/meminfo        # memory totals, straight from the kernel
$ cat /proc/uptime         # seconds since the kernel started
$ ls /sys/class/net        # network interfaces the kernel knows about

Nothing here is a real file waiting on a disk. Every read is a live question to the kernel, answered on the spot. Tools like free, top, and lscpu are, underneath, just friendly readers of these same virtual files.

5.3 The Kernel's Own Log: dmesg

The kernel keeps a running log of its own messages in a memory area called the ring buffer: hardware it detected, drivers it loaded, errors it hit. You read it with dmesg ("display message"):

$ dmesg | head            # earliest boot messages: CPU, memory, devices
$ sudo dmesg -w           # follow new kernel messages live (short for "wait")
$ sudo dmesg -T           # show human-readable timestamps

This is the first place to look when hardware misbehaves. Plug in a USB drive and run dmesg, and you will see the kernel notice the device, load a driver, and name the new disk. On many distributions reading dmesg now needs sudo, because the log can reveal details useful to an attacker.

5.4 One Interface for Every Filesystem: the VFS

Linux reads an ext4 disk, an XFS disk, a Btrfs volume, a FAT USB stick, and a network share over NFS with the exact same commands. That is not luck. The kernel has a layer called the Virtual File System (VFS) that presents one common interface, so cd, ls, cp, and the open and read system calls behave identically no matter which real filesystem sits underneath. Each filesystem type simply plugs into the VFS. You can list every type your kernel currently understands in another virtual file:

$ cat /proc/filesystems     # filesystem types this kernel supports
nodev   sysfs
nodev   proc
        ext4
        xfs
        btrfs

The nodev marker means the type has no backing device, such as the virtual proc filesystem; the others are real on-disk formats. The VFS is why a Linux user rarely has to think about which filesystem they are on: the kernel hides the differences behind one uniform set of files, directories, and permissions.

Back to top

6. Advanced Use Cases

The sections above only read. Here you watch the exact requests programs make to the kernel, change how the kernel behaves while it runs, and see how a kernel is configured at boot. The first of these is the most revealing thing you can do to understand a Linux system.

6.1 Watching System Calls With strace

A system call (syscall) is the actual request a program hands across the line into the kernel: "open this file", "read these bytes", "give me memory". Every real thing a program does is one or more syscalls. The tool strace ("system-call trace") shows them as they happen, and it turns the abstract idea of user space asking kernel space into something you can read:

$ strace -e trace=openat,read cat /etc/hostname
openat(AT_FDCWD, "/etc/hostname", O_RDONLY)  = 3
read(3, "xps\n", 131072)                     = 4
xps

Look at what this shows. To print one tiny file, cat did not touch the disk itself. It asked the kernel to openat the file, got back a number (a file descriptor), then asked the kernel to read from it. The kernel did the disk work and handed back the bytes. Run strace on any program and you see the same pattern: a stream of small requests across the boundary. This is what "everything is a system call" really means.

6.2 Tuning the Live Kernel With sysctl

The kernel exposes hundreds of adjustable settings, called kernel parameters, under /proc/sys. The sysctl command reads and writes them, so you can change the behaviour of the running kernel without a reboot:

$ sysctl vm.swappiness              # read one setting
vm.swappiness = 60

$ sudo sysctl -w vm.swappiness=10   # change it now (short for "write")
$ sudo sysctl net.ipv4.ip_forward=1 # turn the machine into a router

A change made this way lasts until reboot. To make it permanent, you write the same line into a file under /etc/sysctl.d/, and the kernel applies it at every boot. These parameters control real behaviour: how eagerly the system swaps, whether it forwards network packets, how many files may be open at once. They are the supported way to tune a kernel, far safer than rebuilding one.

6.3 The Kernel Command Line

The bootloader hands the kernel a line of options at startup, and the kernel remembers it. You can read exactly what your kernel was told with another virtual file:

$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-6.11.0-29-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro

Here root= tells the kernel which disk holds the real filesystem, and ro says mount it read-only at first. This line is where you add options to fix a broken boot, such as forcing a recovery mode or disabling a driver that hangs the machine. You edit it once from the boot menu for a single boot, or permanently in the bootloader's configuration.

6.4 The Kernel Features Behind Containers: namespaces and cgroups

Containers feel like lightweight virtual machines, but no virtual machine is involved. Docker, Podman, and Kubernetes are built almost entirely from two kernel features you can use directly. Namespaces give a process its own private view of one part of the system, its own process list, network, mounts, or hostname, so it cannot see the rest of the machine. Control groups (cgroups) do the opposite job of limiting and measuring: they cap how much CPU, memory, and I/O a group of processes may use. Put together, that is all a container really is: an ordinary process, fenced off by namespaces and bounded by a cgroup.

$ lsns                       # list the namespaces in use on the system
$ ls /sys/fs/cgroup          # the cgroup tree, exposed by the kernel as files
$ sudo unshare --pid --fork --mount-proc bash   # a shell in its own PID namespace

Run that last command and then type ps: your new shell sees almost no processes, because it lives in its own private process namespace. No container runtime was involved at all. This is what people mean when they say containers are "a kernel feature, not a product": Docker and Kubernetes are convenient tooling layered on top of primitives the kernel already provides.

6.5 Building or Upgrading a Kernel

Almost no one needs to compile their own kernel, because the distribution ships tested ones and updates them for you. But it is possible, and knowing the shape of it demystifies the kernel: it is a program you can build from source like any other, just a very large one.

$ make menuconfig        # choose which features and drivers to include
$ make -j$(nproc)        # compile, using every CPU core
$ sudo make modules_install install   # place the new kernel in /boot

The output is a fresh vmlinuz file and a matching module directory, added alongside the ones you already have. In normal life you get the same result far more safely by letting your package manager install a newer kernel, then rebooting into it, with the old one still there to fall back on.

Back to top

7. Something Most Users Do Not Know

7.1 The Whole Kernel Is One Small File

It is easy to imagine the kernel as something vast and spread out. It is a single file of around fifteen megabytes in /boot, named vmlinuz. The name itself tells a story: vm because it supports virtual memory, linu for Linux, and a final z because the file is compressed. At boot the kernel unpacks itself into memory, and from then on that one modest file is in complete charge of a machine with gigabytes of RAM and dozens of devices. Everything else on disk is just programs and data that this one file will agree to run.

7.2 Almost Everything You Do Is a System Call

The strace example was a glimpse of a deeper truth: user-space programs cannot do anything real on their own. Printing text, creating a file, opening a network connection, starting another program, reading the clock, all of these are system calls, requests made to the kernel. There are only a few hundred of them, and that short list is the complete vocabulary in which every program on the system asks for anything. When you understand that a program is just a sequence of computations punctuated by syscalls, the whole machine stops being mysterious.

7.3 The Kernel Does Not "Run" Like a Program

You will never see the kernel in a list of processes, because it is not a process. It has no place in the ps output the way a service does. Instead the kernel sits idle until something calls into it: a program makes a system call, or a device raises an interrupt, and the CPU switches into kernel mode, runs the relevant kernel code, and switches back. The kernel is less a program that runs and more a body of code that is entered, does its work, and is left again, millions of times a second. That is why it can manage everything without ever appearing as a running task.

7.4 Modules Are Kernel Code Loaded While You Work

When you plug in a webcam and it simply works, the kernel has just loaded a driver into itself, live, without a reboot. That loadable driver is a module, and it runs with the same full power as the rest of the kernel; there is no safety fence between a module and the core once it is loaded. This is the payoff of the "monolithic but modular" design from the history section: the kernel stays small on disk by keeping the thousands of drivers it might need as separate module files, and pulling in only the ones your actual hardware asks for.

7.5 You Are Almost Certainly Running Several Kernels' Worth of Choices

Every kernel update leaves the previous kernel installed. Over time you accumulate a small stack of them in /boot and /lib/modules, and the boot menu quietly offers them all. This is a deliberate safety net, not clutter: if a new kernel fails to boot or breaks a driver, you reboot, pick the previous one from the menu, and you are working again in seconds. It is the single best reason kernel upgrades on Linux are so low-risk, and it is why clearing out old kernels is something to do carefully, keeping at least one known-good fallback.

7.6 "Linux" Is Only the Kernel

The thing this whole article describes, the kernel, is the only part that is strictly named Linux. The shell you type into, the ls and cat and grep commands, the compiler, the C library: none of those are Linux. They come mostly from GNU and other projects, and they are the same across many operating systems. Linux is the core they all sit on. That is why the careful name for the whole system is GNU/Linux, and why your kernel, asked its operating system with uname -o, answers with exactly that pair of names.

Back to top

8. Best Practices

  • Keep your kernel updated. Security fixes for the most privileged program on the machine arrive as kernel updates. Let your package manager install them and reboot when it asks; the old kernel stays as a fallback.
  • Prefer an LTS kernel for servers. Long-Term Support kernels get years of security fixes; chasing the newest mainline release on a production box trades stability for features you rarely need.
  • Always keep at least one older kernel installed. When you clean up /boot, never remove every previous version. One known-good kernel in the boot menu turns a failed upgrade into a two-minute recovery.
  • Tune with sysctl, do not rebuild. Almost everything you might want to change is a kernel parameter under /proc/sys. Reach for sysctl and /etc/sysctl.d/ long before you consider compiling a kernel.
  • Make kernel settings permanent in /etc/sysctl.d/. A change made with sysctl -w is lost at reboot. Put it in a file there so the kernel reapplies it every boot.
  • Read dmesg first for hardware trouble. Before guessing, look at what the kernel itself reported. Newly plugged devices, failing disks, and driver errors all show up there.
  • Learn to read a system call trace. When a program fails for no obvious reason, strace often shows the exact syscall that returned an error, which turns a mystery into a specific missing file or denied permission.
  • Stick to your distribution's kernels. They are built, signed, and tested for your system. A custom kernel is a maintenance burden you take on yourself, worth it only for special hardware or real expertise.
  • Read the documentation. The kernel is heavily documented. man uname, man sysctl, man dmesg, and the kernel's own docs at kernel.org/doc are the reference.
$ man uname       # reading system and kernel identity
$ man modprobe    # loading and removing kernel modules
$ man sysctl      # reading and writing kernel parameters
$ man dmesg       # the kernel ring buffer
Back to top

9. Common Mistakes

9.1 Myth versus Reality

MythReality
"Linux is a whole operating system." Linux is only the kernel. The shell, commands, and libraries are separate projects, mostly GNU, hence "GNU/Linux".
"The kernel is a running program I can see in ps." It is not a process. The CPU enters kernel code on a system call or interrupt, then leaves; it never appears as a task.
"Programs read the disk and memory themselves." They cannot. Every real action is a system call asking the kernel, which does the work on their behalf.
"To change kernel behaviour you must recompile it." Hundreds of settings are live parameters. sysctl changes most of them without a reboot, let alone a rebuild.
"Updating the kernel replaces the old one." The previous kernel stays installed and bootable, on purpose, so a bad update is easy to undo from the boot menu.
"A bigger first version number means a major rewrite." Since 3.0, the major number is bumped mostly to keep the minor number small, not to signal a rewrite.
"Containers are a feature of Docker." Containers are built from kernel namespaces and cgroups. Docker and Kubernetes only orchestrate features the kernel already provides.

9.2 Other Traps to Avoid

  • Deleting all old kernels to free space. Remove old versions carefully and always keep at least one previous kernel, or a failed upgrade can leave you with no way to boot.
  • Making a sysctl change and expecting it to survive a reboot. A live change with -w is temporary. Write it into /etc/sysctl.d/ to make it permanent.
  • Confusing kernel version with distribution version. Ubuntu 24.04 and the kernel 6.11 are two different things. uname -r gives the kernel; /etc/os-release gives the distribution.
  • Compiling a custom kernel without a fallback. Always leave the working distribution kernel installed and in the boot menu, so a broken custom build is not a dead machine.
  • Assuming the kernel logs to /var/log only. The kernel's own live buffer is dmesg. Text logs are written from it afterwards; the buffer is the source.
  • Loading a module built for a different kernel. Modules are tied to the exact kernel version they were built for, which is why each kernel has its own /lib/modules directory.
Back to top

10. Summary

The kernel is the core of a Linux system: the one program that is allowed to touch the hardware, the referee that shares the CPU, memory, disks, and network safely among everything else, and the part that is really named Linux. Everything you run is a guest asking this core for help, one system call at a time. See it that way and the whole machine becomes something you can reason about.

  • The kernel is the central program of the operating system, running in privileged kernel mode while every other program runs fenced off in user mode.
  • Its jobs are scheduling processes, managing memory, running filesystems and device drivers, handling networking, and answering system calls.
  • The name means the core inside the shell; Linux is the kernel alone, which is why the full system is called GNU/Linux.
  • It began as Linus Torvalds's 1991 hobby, is monolithic but modular, and now runs on nearly everything, with a new stable release every few weeks.
  • You read it with uname, /proc/version, and the single vmlinuz file in /boot, and you keep several kernels installed as fallbacks.
  • Modules are drivers loaded into the live kernel on demand; inspect them with lsmod and modinfo, manage them with modprobe.
  • procfs (/proc) and sysfs (/sys) expose the kernel's state as virtual files, and dmesg shows its own message buffer.
  • strace reveals the system calls a program makes; sysctl tunes the live kernel; /proc/cmdline shows how it was booted.
  • It keeps two constant illusions running: scheduling gives every process a fair slice of the CPU through context switching, and virtual memory gives each one its own private address space, paging and caching behind the scenes.
  • The VFS presents one interface over every filesystem, and namespaces plus cgroups are the kernel features that containers like Docker are built from.
  • Kernels ship as short-lived stable releases and multi-year LTS releases; production systems run the LTS kernel their distribution provides.
  • The kernel is not a process you can see; the CPU enters it on a syscall or interrupt and leaves again, millions of times a second.

This is the quick reference worth keeping:

uname -r                 the kernel version you are running
uname -a                 kernel, host, release, arch, and OS in one line
cat /proc/version        who built the kernel, and with what
ls /boot/vmlinuz*        the kernel image files on disk
ls /lib/modules          every installed kernel, by version
lsmod                    modules loaded in the kernel right now
modinfo NAME             what one module is and where it lives
sudo modprobe NAME       load a module and its dependencies
cat /proc/cpuinfo        CPUs the kernel sees
cat /proc/meminfo        memory, straight from the kernel
dmesg -T                 the kernel's own log, with timestamps
strace -e trace=openat CMD   watch a program's system calls
sysctl NAME              read a kernel parameter
sudo sysctl -w NAME=VAL  change the live kernel
cat /proc/cmdline        the options the kernel was booted with
nice -n 10 CMD           run a command at low CPU priority
cat /proc/filesystems    filesystem types the kernel supports
lsns                     list the kernel namespaces in use
ls /sys/fs/cgroup        the cgroup resource-control tree

A machine whose kernel is kept current, tuned with the supported parameters instead of risky rebuilds, and understood well enough to read its own logs and system calls is a machine that behaves predictably and recovers quickly when something goes wrong. If your servers run kernels no one has updated in years, panic on a bad upgrade because no fallback was kept, or throw hardware errors that nobody knows how to read, it is worth having the core of the system set up and understood properly, so the foundation everything else stands on is solid.

Back to top
Linux concept: kernel
Peter Martin
Peter Martin
Joomla Specialist

Peter is a Joomla specialist and a Linux admin for fast, secure and scalable websites.