[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedMarch 21, 2023

How to Check Linux Version.

How To Check Linux Version.

This article shows how to check what Linux distribution and version is installed on your system using the command line.

Some of the most popular Linux distributions are Debian, Red Hat, Ubuntu, Arch Linux, Fedora, CentOS, Kali Linux, OpenSUSE, Linux Mint, etc.

A Linux distribution is an operating system made from a Linux kernel, GNU tools and libraries, and software collections. Usually, Linux distributions include desktop environments, package management system, and a set of preinstalled applications.

 

lsb_release command

The lsb_release utility displays LSB (Linux Standard Base) information about the Linux distribution. This command should work on all Linux distributions that have the lsb-release package installed:

lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.5 (stretch)
Release:	9.5
Codename:	stretch

The Linux distribution and version are shown in the Description line. As you can see from the output above, I have Debian GNU/Linux 9.5 (stretch) installed on my system.

Instead of printing all of the above information, you can display the description line, which shows your Debian version passing the -d switch.

lsb_release -d

The output should look similar to below:

Description:	Debian GNU/Linux 9.5 (stretch)

If you get “command not found: lsb_release” you can try to identify the Linux version using some of the other methods below.

 

/etc/os-release file

The /etc/os-release file contains operating system identification data, including information about the distribution. This file is part of the systemd package and should be present on all system running systemd.

To view the contents of the os-release file, use either cat or less :

cat /etc/os-release

The output should look something like below:

PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

 

/etc/issue file

The /etc/issue file contains a system identification text that is printed before the login prompt. Usually, this file includes information about the Linux version:

cat /etc/issue

The output will look something like this:

Debian GNU/Linux 9 \n \l

 

hostnamectl command

hostnamectl utility is part of systemd and is used to query and change the system hostname. This command also displays the Linux distribution and kernel version .

hostnamectl
  Static hostname: debian9.localdomain
         Icon name: computer-vm
           Chassis: vm
        Machine ID: a92099e30f704d559adb18ebc12ddac4
           Boot ID: 7607cbe605d44f638d6542d4c7b3878e
    Virtualization: qemu
  Operating System: Debian GNU/Linux 9 (stretch)
            Kernel: Linux 4.9.0-8-amd64
      Architecture: x86-64

 

/etc/*release file

If none of the commands above work for you, then most likely, you are running a very old and outdated Linux distribution. In this case, you can use one of the following commands, which should print the content of the distribution release or version file:

cat /etc/*release
cat /etc/*version

You can find more information about the release/version files at this link .

 

uname command

The uname command displays several system information, including the Linux kernel architecture, name, version, and release.

To find out what version of the Linux kernel is running on your system, type the following command:

uname -srm
Linux 4.9.0-8-amd64 x86_64

The output above tells us that the Linux kernel is 64-bit, and its version is “4.9.0-8-amd64”.

 

Conclusion

There are several different commands that can help you find out the Linux distribution and version is running on the system.

Keep reading
How to use Gunzip Command.
March 15, 2023

How to use Gunzip Command.

How To Use Gunzip Command. Gunzip is a command-line tool for decompressing Gzip files. Gzip is one of the most popular compression algorithms that reduce the size of a file and keep the original file mode, ownership, and timestamp. By convention, files compressed with Gzip are given either the .gz…

Read article
How to use Chmod Command.
March 15, 2023

How to use Chmod Command.

How To Use Chmod Command. This tutorial covers how to use the chmod command to change the access permissions of files and directories. In Linux, access to the files is managed through the file permissions, attributes, and ownership. This ensures that only authorized users and processes can access…

Read article
How to use whereis command.
March 15, 2023

How to use whereis command.

How To Use Whereis Command. In this article, we will show you how to use the Linux whereis command. whereis is a command-line utility that allows you to find the location of the binary, source, and manual page files for a given command. How to Use the whereis Command The syntax for the whereis…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, cloud hosting, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00