Thursday, March 12, 2015

How to find out linux distribution name and version


How do I find out what version of Linux distribution I'm using from the shell (bash) prompt?

You can use any one of the following method to find out your Linux distribution and name:

Method #1: /etc/*-release file

To find out what version of Linux (distro) you are running, enter the following command at the shell prompt:



$ cat /etc/*-release


Sample output from my CentOS 6.6:


[root@localhost ~]# cat /etc/*-release
CentOS release 6.6 (Final)
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
CentOS release 6.6 (Final)
CentOS release 6.6 (Final)


Method #2: lsb_release Command To Find Out Linux Distribution Name/Version
The lsb_release command displays certain LSB (Linux Standard Base) and distribution-specific information. Type the following command:


$ lsb_release -a


Sample outputs:


[root@localhost ~]# lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.6 (Final)
Release:        6.6
Codename:       Final


How Do I Find Out My Kernel Version?


Type the following command:


$ uname -a


Or


$ uname -mrs


Sample outputs:


[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-504.el6.x86_64 #1 SMP Wed Oct 15 04:27:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# uname -mrs
Linux 2.6.32-504.el6.x86_64 x86_64

Where,

  1. Linux - Kernel name
  2. 2.6.32-5-amd64 - Kernel version number
  3. x86_64 - Machine hardware name (64 bit)


References

No comments:

Post a Comment