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.

[ You might also like: How to Find Linux System (64-bit/32-bit) Architecture ]

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:

$ uname -or

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:

$ uname -a
Check Linux Kernel Version
Check the Linux Kernel Version

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:

$ cat /proc/version
Show Linux System Information
Show Linux System Information

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

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.

$ lsb_release -a
Find Linux OS Information
Find Linux OS Information

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.

$ hostnamectl
Check Linux System Info
Check Linux System Info

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.

If you read this far, tweet to the author to show them you care. Tweet a thanks
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 thoughts on “How to Find Linux OS Name and Kernel Version You Are Running”

  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.