How to Find out Linux Version currently Installed on your Machine?


Are you new to Linux/Ubuntu? Do you know, which version of Ubuntu/Linux is currently installed on your machine? If you are in a dilemma, then this article explains you about how to find out Linux version currently installed on your machine.

Method 1

Use the following command to find Ubuntu version as shown below −

$cat /etc/*-release

The sample output should be like this –

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial

To get the kernel information about Linux machine, use the following command as shown below −

$ hostnamectl

Sample output should be like this−

Static hostname: tutorialspoint-Inspiron-3541
Icon name: computer-laptop
Chassis: laptop
Machine ID: 5723a90b27e94b9f857fa8eb5b69d189
Boot ID: dbf579d74c9740c7a180cf00f760b4e1
Operating System: Ubuntu 16.04.1 LTS
Kernel: Linux 4.4.0-31-generic
Architecture: x86-64

Method 2

Use the following command to get the Linux kernel information as shown below

$ uname -mrs

The sample output should be like this −

Linux 4.4.0-31-generic x86_64

Method 3

Use the following command to get the Linux kernel information as shown below

$ cat /proc/version

The sample output should be like this −

Linux version 4.4.0-31-generic (buildd@lgw01-16) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2.1) ) #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016

Method 4

If you are using python, use the following command to get the information about Linux Kernel

$python -c "import platform;print(platform.platform())"

The sample output should be like this −

Linux-4.4.0-31-generic-x86_64-with-Ubuntu-16.04-xenial

After this article, you will be able to understand How to find out Linux version currently installed on your Machine. In our next articles, we will come up with more Linux based tricks and tips. Keep reading!

Updated on: 28-Jan-2020

155 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements