There are several ways to find out which version of Linux you’re running on your system, including your distribution name, architecture, kernel version, and other important system information that you should have at your fingertips.
In this guide for Linux users, I’ll show you how to find your Linux system’s operating system version from the command line. While this may seem like a straightforward task, having a solid understanding of your system is always recommended for several important reasons:
- Installing and running the correct packages for your Linux version.
- Troubleshooting system issues effectively.
- Reporting bugs with accurate system information.
- Ensuring compatibility with software and drivers.
- Planning system upgrades.
With that said, let’s explore the different methods to identify your Linux distribution and version.
Method 1: Find Linux Kernel Version Using uname Command
The uname command is the quickest way to check your Linux kernel version and system information, as this command displays essential details such as kernel version, release name, network hostname, machine hardware name, processor architecture, and operating system.
To find out which Linux kernel version you’re running, type:
uname -or
In the command above, the option -o prints the operating system name, and -r prints the kernel release version.
You can also use the -a option to display all available system information at once:
uname -a

Method 2: Check Kernel Version Using /proc/version File
The /proc filesystem stores real-time information about running processes and system details. It’s automatically mounted at boot time and provides another reliable way to check your kernel version.
To view your system information, including the kernel version:
cat /proc/version

From this output, you can identify:
- 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
Method 3: Find Linux Distribution Name and Release Version
The most reliable way to determine your Linux distribution name and version is by using the /etc/os-release file, which works across virtually all modern Linux distributions.
Using /etc/os-release file:
cat /etc/os-release # Works on most Linux distributions
For specific distributions:
cat /etc/os-release # Debian, Ubuntu, Linux Mint cat /etc/os-release # RHEL, CentOS, Fedora, Rocky Linux, AlmaLinux cat /etc/gentoo-release # Gentoo Linux cat /etc/os-release # Alpine Linux cat /etc/os-release # Arch Linux cat /etc/os-release # OpenSUSE

This gives you complete information about your distribution, including the name, version, codename, and family.
Method 4: Check Linux Version Using lsb_release Command
The lsb_release command displays LSB (Linux Standard Base) information about your Linux distribution, and it provides standardized output across different distributions.
Note: The lsb_release command is not installed by default on all systems, so you need to install it using your package manager:
sudo apt install lsb-release # Debian, Ubuntu, Linux Mint sudo yum install redhat-lsb-core # RHEL, CentOS, Fedora, Rocky Linux, AlmaLinux sudo dnf install redhat-lsb-core # Fedora, RHEL 8+, Rocky Linux, AlmaLinux sudo emerge -a sys-apps/lsb-release # Gentoo Linux sudo apk add lsb-release # Alpine Linux sudo pacman -S lsb-release # Arch Linux sudo zypper install lsb-release # OpenSUSE
Once installed, run the command to display distribution information:
lsb_release -a

You can use specific options for targeted information:
lsb_release -d # Description only lsb_release -r # Release number only lsb_release -c # Codename only
Method 5: Display System Info Using hostnamectl Command
The hostnamectl command is a systemd utility that displays detailed operating system information, and it is available on all modern Linux distributions that use systemd (which includes most current distributions).
hostnamectl

This command provides comprehensive information, including:
- Operating system name and version.
- Kernel version.
- System architecture.
- Hardware details.
- Machine and boot IDs.
Method 6: Check Distribution-Specific Release Files
Some Linux distributions maintain their own release files with version information and are distribution-specific commands:
cat /etc/redhat-release # RHEL, CentOS, Fedora, Rocky Linux, AlmaLinux cat /etc/debian_version # Debian cat /etc/lsb-release # Ubuntu (older versions) cat /etc/arch-release # Arch Linux
Quick Reference: Essential Commands Summary
Here’s a quick reference table for all the methods covered:
| Command | What It Shows | Best For |
|---|---|---|
uname -r |
Kernel version only | Quick kernel check |
uname -a |
Complete system info | Comprehensive overview |
cat /proc/version |
Kernel build details | Detailed kernel info |
cat /etc/os-release |
Distribution details | Most reliable method |
lsb_release -a |
LSB-compliant info | Standardized output |
hostnamectl |
OS and hardware info | Systemd-based systems |
I’ve used the tmux terminal multiplexer for accessing multiple Linux terminal sessions simultaneously in a single terminal window.
Conclusion
In this guide, we covered six different methods to find your Linux distribution name and kernel version from the command line. The /etc/os-release file method is the most universal and reliable approach, while uname provides the quickest way to check kernel information.
For advanced system monitoring and hardware information, you might also want to explore tools like screenfetch, or inxi, which provide beautifully formatted system summaries.
Have questions or tips about checking Linux versions? Share them in the comments below!






Where is the OS version number being written? when I open “System Information” or “About this System”, it shows an incorrect version number…
@Andre,
Hello,
The OS version number is typically stored in system configuration files. For many Linux distributions, this information can be found in /etc/os-release or /etc/lsb-release. If you’re using a different OS, the location might vary.
If the “System Information” or “About this System” is displaying an incorrect version number, it’s possible that the respective file has outdated or incorrect information. You might want to check these files directly to see if they match what’s being displayed.
If you need assistance in locating or updating these files, or if you have further questions, please let me know.
A command line is something that interacts directly with the inner systems of a computer. (terminal, command line, etc)
This is very helpful.
What about multiboot systems, is there command for listing all installed linux os by partition? i.e. I have installed 3 different linux systems each on their different partition segments.
How can I find out which partition has which linux OS and version? I know when I install a new linux system the guided process let me view the existing installed OS version by partition table, can i view the same info by running a command?
@D
You can only tell the filesystem type (EXT2, EXT3, EXT4, BTRFS etc..) on a partition, not the Linux OS/distribution installed.
“To find out which version of Linux kernel you are running, type:”
TYPE IT WHERE? You do not give the ESSENTIAL INFORMATION. Command Line? WHERE IS THAT?
~
Websites constantly say TYPE THIS OR THAT, but WHERE?????
In a terminal, you type commands in a terminal
@Chris
Sorry about this, as you’ve mentioned, we normally do this a lot, i guess it’s because we spend so much time running commands and all we know(or think of) is the command line interface or terminal to have access to Linux.
However, many thanks for the heads up, we’ll work towards giving essential information to readers in future articles.
cat /etc/*{release,version}
@seeker
Works well, thanks for the suggestion.
Contents of a file can be modified.
I use this:
Haven’t tried it but this would probably work:
@RabidPhilbrick
Okay. Thanks for the idea.
or just install screenfetch
Safest way, works on almost all Linux versions.
cat /etc/*release.
@Aram
Yes, good hint, it’s a summarized command. Thanks for getting in touch.
Simpler option:
lsb_release -a
@GM
Thanks for the suggestion, it works fine as well.