The kernel is the absolute core of your Linux operating system. It acts as the bridge between your computer’s physical hardware (like the CPU, memory, and graphics card) and the software applications you run. Occasionally, when compiling software from source code or checking hardware compatibility, you will be asked, “What kernel version are you running?” Finding the answer takes less than a second using the terminal.
Method 1: The uname Command (The Best Way)
The standard tool for fetching system information in Linux is uname. This command works on absolutely every Linux distribution (Ubuntu, Fedora, Arch, CentOS, etc.).
- Open your terminal window (on Ubuntu, press Ctrl + Alt + T).
- Type the following command and press Enter:
uname -r
The terminal will output a string of numbers and letters, for example: 5.15.0-76-generic.
Understanding the Output
Let’s break down what those numbers actually mean, using 5.15.0-76-generic as an example:
- 5: The Main Kernel Version. This number changes rarely, only when major architectural shifts happen in the Linux kernel project.
- 15: The Major Revision. This number indicates new features and driver updates.
- 0: The Minor Revision. This indicates bug fixes and security patches.
- 76: The Patch number specific to your distribution (like Ubuntu).
- generic: This means you are running the standard desktop/server kernel, rather than a specialized low-latency kernel for audio production.
Method 2: Using the hostnamectl Command
If you use a modern Linux distribution running systemd (which is almost all of them nowadays), you can use the hostnamectl command. This method is great because it tells you your kernel version alongside other useful operating system details.
hostnamectl
Look through the output block for the line that says Kernel: (e.g., Kernel: Linux 5.15.0-76-generic).
Method 3: Reading the /proc/version File
In Linux, “everything is a file,” including system state information. You can print the contents of the kernel version file directly to your screen using the cat command.
cat /proc/version
This will output a long sentence detailing not just the kernel version, but also the specific compiler (GCC) version that was used to build it and the exact timestamp of when it was compiled.
Conclusion
While uname -r is the fastest and most standard method, all three of these commands will instantly provide the kernel information you need for troubleshooting, compiling drivers, or reporting bugs.