How to Check Your Linux Kernel Version Using the Command Line

The Linux kernel is the core component of your operating system. It sits between your computer’s hardware and the software applications you run, managing memory, CPU resources, and peripheral devices. While most casual users never need to worry about the kernel, system administrators and developers often need to know their exact kernel version to compile software from source, install specific hardware drivers, or patch known security vulnerabilities.

Because Linux is heavily command-line oriented, finding this information does not require clicking through graphical menus. Instead, you can retrieve your exact kernel version instantly using a few simple terminal commands. These commands are universal and will work across almost any Linux distribution, including Ubuntu, Debian, Fedora, CentOS, and Arch Linux.

Method 1: Use the ‘uname’ Command (The Standard Method)

The uname (Unix name) command is the oldest and most reliable way to print system information to the terminal. It is built into the core utilities of virtually every Linux and Unix-like operating system.

  1. Open your terminal application. (On many desktop environments, you can press Ctrl + Alt + T).
  2. Type the following command and press Enter: uname -r
  3. The terminal will output a string of numbers and letters, such as 5.15.0-76-generic.

How to read the output:

  • 5 is the main kernel version.
  • 15 is the major revision number.
  • 0 is the minor revision number.
  • 76 is the patch or bug fix number specific to your distribution.
  • generic indicates the specific kernel flavour (in this case, a standard desktop/server kernel rather than a low-latency or real-time one).

If you want to see even more details, including your machine’s hardware architecture (e.g., x86_64) and the exact date the kernel was compiled, type uname -a instead.

Method 2: Use the ‘hostnamectl’ Command

If your Linux distribution uses Systemd (which almost all modern distributions like Ubuntu 16.04+ and CentOS 7+ do), you can use the hostnamectl command. This command is normally used to change the computer’s network name, but running it without any arguments provides a nice, human-readable summary of your system.

  1. Open your terminal.
  2. Type the following command and press Enter: hostnamectl
  3. Look at the output block. You will see several lines of information, including your operating system name, architecture, and a dedicated Kernel line.

The output will look similar to this: Kernel: Linux 5.15.0-76-generic.

Method 3: Read the /proc/version File

In Linux, everything is treated as a file, including system hardware and running processes. The /proc directory contains virtual files that output live kernel data when you read them.

  1. Open your terminal.
  2. Type the following command and press Enter: cat /proc/version

This will output a long string that includes the kernel version, the version of the GCC compiler used to build it, and the exact timestamp of compilation. It is less concise than the uname command, but it provides excellent detail when you are debugging deep system issues.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.