There are various reasons why you might want to find which Linux distribution you are using or the OS version of your Linux system.
Related: What Is Linux? A Guide for Non-technical Users
When most people talk of Linux, they are usually referr to a Linux distribution, but this is not the case. Above all, “What Linux version am I running?” can mean two different things.
1. Linux Kernel
Most people think of Linux as an operating system, but it is a kernel. A kernel is the lowest level of software that can interface with computer hardware.
In other words, the kernel is a bridge between the software and hardware of a computer.
2. Linux OS
On the other side, Linux-based operating systems are called Linux distributions which usually include the Linux kernel and software package managers, software, and graphical user interface.
Generally speaking, Linux operating system has primarily three components:
- The kernel is a program at the heart of the Linux operating system that takes care of fundamental stuff, like letting hardware communicate with software.
- System Libraries are special functions or programs using which application programs or system utilities access the kernel’s features. These libraries implement most of the functionalities of the operating system.
- System Utility programs are responsible for doing specialized, individual-level tasks.
What Linux Version Am I Running?
Let’s find out now how to check what Linux distribution and kernel version is installed on your system using the command line.
How to Find Out Linux Distribution Name and Its Release Version
There are several ways to determine what distribution and its version number are running on a system. Below we will show you the three most commonly used approaches.
1. Displaying the contents of the /etc/os-release file
Open the terminal and type the following command:
cat /etc/os-release
Here is what the output of the command looks like in Debian:
And here’s what it looks like in an RHEL-based distribution, in this case, AlmaLinux:
As you can see, the /etc/os-release
file contains operating system identification data, including information about the distribution and its release version.
This file is part of the systemd package and should be present on all modern Linux distributions running systemd.
2. Displaying the contents of the /etc/issue file
For a more straightforward response to your request for a Linux OS version number, try this cat
command:
cat /etc/issue
3. Using the lsb_release command
The lsb_release
command is a helpful utility to find out information about your Linux installation. It displays LSB (Linux Standard Base) information about the Linux distribution.
The syntax is:
lsb_release -a
The lsb_release
command should work on every Linux distribution, as long as you’ve installed the lsb-release
package.
For more about the lsb_release
command in Linux, consult its manual page.
How to Check Linux Kernel Version
If you’d like to know which version of the Linux kernel you’re using, type the following command into the terminal and press enter:
uname -a
The command uname -a
shows the version of the Linux kernel you’re using and additional details.
To obtain more detailed Linux kernel information, you can also read the contents of the /proc/version
file.
cat /proc/version
As you can see, the /proc/version
file specifies the version of the Linux kernel, the version of GCC used to compile the kernel and the kernel compilation time. It also contains the kernel compiler’s user name.
Conclusion
Now you know how to check what Linux version you’re running. From all the information mentioned above, I hope you can now find the installed version of any Linux distribution.
If you feel any difficulty related to the ways mentioned above, then let us know via your feedback in the comments. We will welcome your queries.
Are you new to Linux? Here is the list of basic Linux commands containing all the common commands you’ll need to know to get you started.