How to Check Linux OS Name and Kernel Version [6 Quick Methods]

Take Your Linux Skills to the Next Level All courses, certifications, ad-free articles & community — from $8/mo
Join Root →
Ad-free access to all premium articles
Access to all courses: Learn Linux, AI for Linux, Bash Scripting, Ubuntu Handbook, Golang and more.
Access to Linux certifications (RHCSA, RHCE, LFCS and LFCA)
Access new courses on release
Get access to weekly newsletter
Priority help in comments
Private Telegram community
Connect with the Linux community
From $8/mo · or $59/yr billed annually · Cancel anytime

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
Check Linux Kernel Version
Check the Linux Kernel Version

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
Show Linux System Information
Show Linux System Information

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  
Find Linux Distribution Name and Release
Find Linux Distribution Name and Release

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
Find Linux OS Information
Find Linux OS Information

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
Check Linux System Info
Check Linux System Info

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!

Related Articles:

Root Plan
Premium Linux Education for Serious Learners

Take Your Linux Skills to the Next Level

Root members get full access to every course, certification prep track, and a growing library of hands-on Linux content — with new courses added every month.

What You Get
Ad-free access to all premium articles
Access to all courses: Learn Linux, AI for Linux, Bash Scripting, Ubuntu Handbook, Golang and more.
Access to Linux certifications (RHCSA, RHCE, LFCS and LFCA)
Access new courses on release
Get access to weekly newsletter
Priority help in comments
Private Telegram community
Connect with the Linux community
Aaron Kili
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

17 Comments

Leave a Reply
  1. Where is the OS version number being written? when I open “System Information” or “About this System”, it shows an incorrect version number…

    Reply
    • @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.

      Reply
  2. 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?

    Reply
    • @D

      You can only tell the filesystem type (EXT2, EXT3, EXT4, BTRFS etc..) on a partition, not the Linux OS/distribution installed.

      Reply
  3. “To find out which version of Linux kernel you are running, type:”

    $ uname -or...
    

    TYPE IT WHERE? You do not give the ESSENTIAL INFORMATION. Command Line? WHERE IS THAT?
    ~
    Websites constantly say TYPE THIS OR THAT, but WHERE?????

    Reply
    • @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.

      Reply
  4. Contents of a file can be modified.

    I use this:

    # rpm -q --whatprovides /etc/redhat-release
    

    Haven’t tried it but this would probably work:

    # rpm -q --whatprovides /etc/*release
    
    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

Root Plan Premium Linux Education for Serious Learners

Before You Go - Upgrade Your Linux Skills

Root members get everything in one place, with new courses added every month.

What You Get
Ad-free access to all premium articles
Access to all courses: Learn Linux, AI for Linux, Bash Scripting, Ubuntu Handbook, Golang and more.
Linux certifications: RHCSA, RHCE, LFCS and LFCA
Access new courses on release
Weekly newsletter, priority support & Telegram community
Join Root Today and Start Learning Linux the Right Way
Structured courses, certification prep, and a community of Linux professionals - all in one membership.
Join Root Plan →
$8/mo · or $59/yr billed annually