- How do I find out the kernel version I am running?
- 6 Answers 6
- How to Check Kernel Version in Linux in Command Line
- 4 Commands to Find Linux Kernel Version
- uname Command
- hostnamectl Command
- Display the /proc/version File
- dmesg Command
- How to Find Linux OS Name and Kernel Version You Are Running
- Find Linux Kernel Version Using uname Command
- Find Linux OS Info Using /proc/version File
- Find the Linux Distribution Name and Release Version
- /etc/os-release file
- lsb_release Command
- hostnamectl Command
How do I find out the kernel version I am running?
I need this info so I can finish updating my STA Broadcom wireless. However, I’m a noob at Ubuntu and I’m not sure how to find the kernel version or kernel. I checked /lib/modules/ and found this:
2.6.27-10-generic 2.6.32-30-generic 2.6.32-34-generic 2.6.32-38-generic 2.6.27-7-generic 2.6.32-31-generic 2.6.32-35-generic 3.2.0-54-generic 2.6.28-19-generic 2.6.32-32-generic 2.6.32-36-generic 3.2.0-54-generic-pae 2.6.31-23-generic 2.6.32-33-generic 2.6.32-37-generic
Which one is the running kernel? Another question. Is there a snippet so I don’t have to cut and paste? Thanks for your time! 🙂
6 Answers 6
Well there are multiple ways to find the kernel version
Open terminal and execute:
It would display something like:
You can get further information on the current kernel with
It would display something like:
Linux saurav-P4I45Gx-PE 3.8.0-30-generic #44~precise1-Ubuntu SMP Fri Aug 23 17:33:45 UTC 2013 i686 i686 i386 GNU/Linux
Another way to know the kernel version is to open Synaptic Package Manager and search for linux image . You have to check for the installed Kernel version.
Another way to find version of installed kernels is to run this command:
dpkg -l | grep linux-image | grep ii
or for just the version strings:
dpkg -l | grep linux-image | grep ii | awk ''
The latest kernel (the one with the highest version number) will boot by default, so if you have rebooted since the last kernel update, and you have not made adjustments to boot into a kernel other than the default, then you can be reasonably confident that the highest version number displayed will be the version of the running kernel, but you should use uname for more reliable information.
How to Check Kernel Version in Linux in Command Line
The Linux kernel is much like the central brain of the operating system. Although it is open-source – meaning anyone can view and modify the code – the Linux kernel is built with multiple protocols to ensure stability and security.
This guide will walk you through how to check the Linux kernel version of your distribution.
- A system running Linux (Ubuntu, Debian, RHEL, CentOS, or another version)
- A terminal window / command line (Ctrl–Alt–T, Ctrl–Alt–F2)
4 Commands to Find Linux Kernel Version
uname Command
Launch a terminal window, then enter the following:
The system will return a numeric code, for example:
Each number, separated by a dot or hyphen, is part of a code:
The uname command includes additional options that you can use to get more information about your kernel. Simply add an option after the command:
- -a – Display all information
- -o – Display the operating system (usually GNU/Linux)
- -r – Display kernel release
- -v – Display kernel version (usually includes the base OS and time the kernel was compiled)
For a full list of uname commands, enter
Note: Your kernel version will likely be different than this example. At the time of writing this article, the latest version is Linux kernel 5.0.
hostnamectl Command
The hostnamectl command is typically used to display information about the system’s network configuration. It also displays the kernel version.
To check the kernel version, enter the following:
The second-to-last line should read:
Kernel: Linux 3.10.0-957.21.2.el7.x86_64
Display the /proc/version File
To display the proc/version file, enter the command:
The cat command displays the contents of the /proc/version file. This will output the Linux kernel version first, along with additional data about your operating system.
dmesg Command
The dmesg command is used to print the message buffer of the kernel. This is usually used to read messages from device drivers, but it can also be used to find the kernel version.
The | (pipe) symbol is usually on the same key as the symbol, just above the enter key.
The commands work as follows:
- dmesg – read the contents of the kernel buffer
- | – pipe the command into the next command
- grep – search for a particular string of characters, and display lines that contain them
- Linux – the exact string of characters that grep should search for (capitalization matters)
The first line of output displays the Linux kernel version.
Note: When updating your kernel, it is recommended that you choose a release version that’s compatible with your version of Linux. Your package manager will typically give you kernel versions that are tested and verified.
This guide showed you several different ways to check the Linux kernel version. Since you’re only reading the output of a file, you shouldn’t need sudo privileges.
The Linux kernel has a modular design. Functionality is extendible with modules or drivers. Learn how to use the modprobe command to add or remove modules on Linux.
How to Find Linux OS Name and Kernel Version You Are Running
There are several ways of knowing the version of Linux you are running on your machine as well as your distribution name and kernel version plus some extra information that you may probably want to have in mind or at your fingertips.
Therefore, in this simple yet important guide for new Linux users, I will show you how to find out your Linux system OS version from the command line. Doing this may seem to be a relatively easy task.
However, having a good knowledge of your system is always a recommended practice for a good number of reasons including installing and running the appropriate packages for your Linux version, for easy reporting of bugs coupled with many more.
With that said, let us proceed to how you can figure out information about your Linux distribution.
Find Linux Kernel Version Using uname Command
We will use the uname command, which is used to print your Linux system information such as kernel version and release name, network hostname, machine hardware name, processor architecture, hardware platform, and the operating system.
To find out which version of Linux kernel you are running, type:
In the preceding command, the option -o prints the operating system name, and -r prints the kernel release version.
You can also use -a option with uname command to print all system information as shown:
Find Linux OS Info Using /proc/version File
Next, we will use /proc file system, which stores information about processes and other system information, it’s mapped to /proc and mounted at boot time.
Simply type the command below to display some of your system information including the Linux kernel version:
From the image above, you have the following information:
- A version of the Linux (kernel) you are running: Linux version 5.15.0-53-generic
- Name of the user who compiled your kernel: [email protected]
- A version of the GCC compiler used for building the kernel: gcc version 20.04.1
- Type of the kernel: #1 SMP (Symmetric MultiProcessing kernel) supports systems with multiple CPUs or multiple CPU cores.
- Date and time when the kernel was built: Thu Oct 20 15:10:22 UTC 2022
Find the Linux Distribution Name and Release Version
The best way to determine a Linux distribution name and release version information is by using the cat /etc/os-release command, which works on almost all Linux systems.
/etc/os-release file
$ cat /etc/os-release [On Debian, Ubuntu and Mint] $ cat /etc/os-release [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux] $ cat /etc/gentoo-release [On Gentoo Linux] $ cat /etc/os-release [On Alpine Linux] $ cat /etc/os-release [On Arch Linux] $ cat /etc/SuSE-release [On OpenSUSE]
lsb_release Command
Alternatively, you can also use the lsb_release tool, which will print LSB (Linux Standard Base) information about the Linux distribution on your terminal. The lsb_release command is not installed by default, you need to install it using your default package manager as shown.
$ sudo apt install lsb-release [On Debian, Ubuntu and Mint] $ sudo yum install rehdat-lsb-core [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux] $ sudo emerge -a sys-apps/lsb-release [On Gentoo Linux] $ sudo apk add lsb_release [On Alpine Linux] $ sudo pacman -S lsb-release [On Arch Linux] $ sudo zypper install lsb-release [On OpenSUSE]
Once installed, run the lsb_release utility to print the standard Linux system information as shown.
hostnamectl Command
The hostnamectl command is a systemd utility that is used to get the Linux operating system information and also used to change or set the system hostname.
I’ve used the tmux terminal multiplexer for accessing multiple Linux terminal sessions simultaneously in a single terminal window.
In this article, we walked through a brief and simple guide intended to help new Linux users find out the Linux version they are running and also get to know their Linux distribution name and version from the shell prompt.
Perhaps it can also be useful to advanced users on one or two occasions. Lastly, to reach us for any assistance or suggestions you wish to offer, make use of the feedback form below.