Sometimes we need to find out Linux distribution name and version of current installed Linux OS. Here is a tutorial addressing this problem.
There are three methods to find out Linux distribution and version:
1. /etc/*-release
2. lsb_release
3. /proc/version
Method 1: /etc/*-release
Issue following command to find out distro and version of installed Linux-
$ cat /etc/*-release
Sample output:
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=16
DISTRIB_CODENAME=petra
DISTRIB_DESCRIPTION="Linux Mint 16 Petra"
NAME="Ubuntu"
VERSION="13.10, Saucy Salamander"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 13.10"
VERSION_ID="13.10"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
Method 2: lsb_release
lsb in lsb_release stands for Linux Standard Base
$ lsb_release -a
Sample output:
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 16 Petra
Release: 16
Codename: petra
Method 3: /proc/version
This command returns kernel version and gcc version which was used to build it.
$ cat /proc/version
Sample output:
Linux version 3.11.0-12-generic ([email protected]) (gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu7) ) #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013
Another way to find kernel version:
This command returns kernel version of currently installed Linux OS.
$ uname -r
or
$ uname -mrs
Sample output:
Linux 3.11.0-12-generic x86_64
Thank you.