Skip to content

How to check the OS version in Linux?

  • by
  • 3 min read
How to check the OS version in Linux? | Candid.Technology

If you’re a frequent Linux user, you’ll know the enormous amount of updates that just keep coming. With so many versions popping out every day, users need to keep an eye out on their installation versions to find better tech support and drivers.

In this article, we tell how you can check your OS version in pretty much every version of Linux.

Also read: How to update Kali Linux?

How to check your OS version in Linux?

There are numerous ways of checking your OS version in Linux. In this post, we’ll be looking at CLI based approaches to maximise compatibility with most Linux versions.

Using etc/os-release/ file

The etc/os-release/ file contains system-specific information about the distribution that you’re running. This file is a part of the systemd package, and all Linux based distros have it.

To see the information in the file, you can either use cat or less.

cat /etc/os-release

This command will fetch an output with all the information that you need.


Also read: How to zip and unzip .GZ files in Linux?

Using lsb_release utility

The LSB-release utility shows all the Linux Standard Base(LSB) information about your particular Linux distribution. To use this command, you need to have the LSB-release utility on your distribution( comes preinstalled in most cases)

lsb_release -a

This command will show you all information about your OS version. If you don’t want the extra jargon, you can go with

lsb_elease -d

The -d flag only shows the distribution version.

The hostnamectl command

Just like the etc/os-release file, the hostnamectl command is a part of the systemd package and can be used to fetch relevant information about the system.

It is usually used to query and change the system hostname but also shows the Linux distribution and kernel version.

hostnamectl

The uname command

The uname command is one of the most basic Linux commands used in system diagnostics. It shows the Linux distribution, kernel version, architecture etc.

uname -srm

The command above will show you the Linux kernel version as well as the distro version.

Also read: What is kernel in Linux?

nv-author-image

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: yadullahabidi@pm.me.

>