How to Find the Linux OS Version Using the Command Line

Linux is an open source Operating System which means that everyone can freely use and modify it. In the Linux operating system there are a lot of distributions or what we are more familiar with the term distributions, some of which are popular Linux distributions, namely Debian, Ubuntu, Arch, Open Suse, CentOS, Fedora and many more.

For some cases there are still many new Linux users who still don’t know complete information about the Linux OS used, such as Linux version, kernal, architectur, etc. There are many ways that we can use to find information about the Linux OS that we use just by using the Command Line or Terminal. Well, below I will share some of the ways of which.

/etc/os-release file

Type the command below

$ cat /etc/os-release

The output results

VERSION="16.04.6 LTS (Xenial Xerus)"
PRETTY_NAME="Ubuntu 16.04.6 LTS"


This command will give you LSB (Linux Standard Base) and distribution specific information.

Type the command below

$ lsb_release -a

The output results

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.6 LTS
Release:        16.04
Codename:       xenial


To check OS name and Kernal Version.

Type the command below

$ hostnamectl

The output results

Static hostname: SANEDU_2
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 00b1c9adfb57a233179106375bc6b295
           Boot ID: 3660ad2b5d5e426c80471d2a425fbda5
    Virtualization: qemu
  Operating System: Ubuntu 16.04.6 LTS
            Kernel: Linux 4.4.0-137-generic
      Architecture: x86-64


Only for knowing the kernal version.

Type the command below

$ uname -r

The output results


Those are some Command Lines that can be used to find out more complete information on the Linux OS you are using.

Leave a Reply

Your email address will not be published. Required fields are marked *