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

Are you new to Linux or Ubuntu? Do you want to know which version of Linux distribution is currently installed on your machine? This article explains various methods to identify your Linux distribution version and kernel information using simple command-line tools.

Method 1: Using /etc/*-release Files

The most comprehensive way to get distribution information is by examining the release files. Use the following command −

$ 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 comprehensive system information including kernel details, use the hostnamectl command −

$ 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: Using uname Command

The uname command provides kernel information. Use the following flags for specific details −

$ uname -mrs

The sample output should be like this −

Linux 4.4.0-31-generic x86_64

Here, -m shows machine hardware name, -r shows kernel release, and -s shows kernel name.

Method 3: Using /proc/version File

The /proc/version file contains detailed kernel compilation information −

$ 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: Using Python Platform Module

If you have Python installed, you can use the platform module to get system information −

$ 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

Comparison of Methods

Method Information Type Best For
cat /etc/*-release Distribution details Complete OS version info
hostnamectl System overview Hostname and OS summary
uname -mrs Kernel basics Quick kernel version check
/proc/version Kernel compilation Detailed kernel build info
Python platform Programmatic access Scripting and automation

Conclusion

These methods provide different levels of information about your Linux system. Use cat /etc/*-release for comprehensive distribution details, uname for quick kernel information, and hostnamectl for a system overview. Choose the method that best fits your specific needs.

Updated on: 2026-03-17T09:01:38+05:30

359 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements