- 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 to Check the OS Version in Linux
- Check OS Version via Command-Line Terminal
- Using the lsb_release Command
- Using /etc/issue File
- Using /etc/os-release File
- Using hostnamectl Command
- Check Kernel Information
- Using uname Command
- Using dmesg Command
- Using /proc/version
- Check OS Version in Linux via Graphical User Interface
- About the author
- Karim Buzdar
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.
How to Check the OS Version in Linux
“Do you know what version of the operating system you have? The administrators and even normal Linux users should know the OS version they are using. It can be useful in various scenarios, such as installing a new application that needs a particular OS version, upgrading the system, checking the availability of various features and troubleshooting issues. Luckily, every Linux distribution lets you check the OS version through multiple ways. This article will describe how you can check the OS version in Linux through both the command-line and the graphical ways.”
Note: We have demonstrated the methods discussed here on Debian 11. The command line method is applicable to all Linux distributions. However, the graphical method will only apply to those systems with GUI installed.
Check OS Version via Command-Line Terminal
In this section, we will discuss some command line ways to check the OS version in a Linux OS. These commands work for all Linux distributions.
You can open the Terminal by pressing the super key on your keyboard and then search for it using the search box at the top. When the Terminal icon appears, click on it to open.
Using the lsb_release Command
The lsb_release command provides the LSB (Linux Standard Base) and distribution-specific information about a Linux distribution. The information comprises of distributor ID, release number, codename, and a brief description. The lsb_release command may not be installed in some Linux versions due to minimal OS installation or another issue. In this case, if you try to run the lsb_release command, you will get the “No LSB modules are available” error.
To install lsb_release, open the Terminal and run the command below based on the Linux distribution you have:
For Ubuntu and Debian
For Fedora, CentOS, and RHEL
For Arch Linux and Manjaro
For openSUSE
Once installed, use the command below to check your Linux OS version:
Your system will display an output similar to the one in the image below. It will display the LSB info particular to your Linux distribution, including your Linux system version, which in our case is Debian 11.
To just display the description that shows the OS version, use the lsb_release command with the -d option:
It will just display the description line of the lsb_release output showing the version number.
Using /etc/issue File
The /etc/issue file contains the system identification text that is displayed before the login prompts. To check your Linux OS version, run the command below:
This command shows the version of your Linux OS. To check the OS version with the point releases, run the command below:
Using /etc/os-release File
The /etc/ost-release file is part of the systemd package and contains OS identification data. You can find this command in every latest Linux distribution, particularly in the systemd distributions. You can also find out the version information of your OS using this file.
To view the content of the /etc/os-release file, use the command below:
Using hostnamectl Command
The hostnamectl command is also a part of the systemd package. Generally, this command is used to check and configure the hostname. However, you can also use it to check the version of your Linux OS. Similar to the above command, you can also find this command in every latest Linux distribution.
To view your Linux OS version, run the following command in Terminal:
Check Kernel Information
If you want to find out the information related to the kernel of your system, the following are some command-line ways to do so:
Using uname Command
The uname command in Linux displays basic operating system and kernel-related information. You can find the kernel release using the uname with -r option as follows:
You will receive the output similar to this:
To find the kernel version, use the uname with -v option:
From the above outputs, you can see the kernel release is 5.10.0-14-amd64, whereas the kernel version is #1 SMP Debian 5.10.113-1 (2022-04-29).
Using dmesg Command
The dmesg command is generally used to display the messages from the kernel’s ring buffer, including system startup messages and initialization messages from the hardware devices and drivers. However, it can also be used to check the version of the kernel. To display the kernel information, pipe the dmesg with the grep command as follows:
You will find the Linux kernel release and the version used in your distribution in the output.
Using /proc/version
The /proc/version file contains information about the Linux kernel version and the GCC compiler used to build it. Run the command below to read the kernel information from the /proc/version file:
You will find the Linux kernel release and the version used in your distribution in the output.
Check OS Version in Linux via Graphical User Interface
This method works for most of Linux distributions with GUI. To check your Linux OS version through the graphical user interface, follow the below-given steps:
Step 1: Open your system’s Settings utility. Right-click on your desktop, and from the context menu, select Settings as demonstrated in the following screenshot:
On the other hand, you can also look for the Settings utility from the Applications menu. Press the super key and type settings in the search box that will appear at the top. When the icon of the Settings utility appears, click it.
Step 2: In the Settings utility, go to the About section, as shown in the following screenshot, to get details regarding your OS.
In the About section, you will find the version of your OS, which is Debian 11. Apart from the OS version, you will find some other information as well, such as OS type, memory, processor, graphics, disk capacity etc.
Note: To find out Debian Latest versions, including the old releases, visit the following page:
Knowing your operating system’s version is important so you can install the right version of the software and follow the proper guide if you run into any issues. In this article, we have covered some methods, including both the graphical and the command line, through which you can view the version of OS as well as the version of the kernel you are running on your system. If you know of some other method that we have missed, we would love to know in the comments below!
About the author
Karim Buzdar
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.