How to Find Out Your Linux Distribution Name And Version

This post will guide you how to find out what name and version of your Linux distribution from the bash shell prompt. How to find out what version of Linux you are running.

find out your linux name and version1

There are many ways to check your Linux distribution name and version. you can use one of the following commands:

$ cat e/etc/*-release
$ lsb_release -a
$ cat /proc/version
$ hostnamectl
$ uname -a
$ dmesg | grep "Linux"
$ yum repolist

Outputs:

[root@mydevops opc]# cat /etc/*-release
CentOS Linux release 7.6.1810 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.6.1810 (Core)
CentOS Linux release 7.6.1810 (Core)

[root@mydevops opc]# cat /proc/version
Linux version 3.10.0-957.27.2.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Mon Jul 29 17:46:05 UTC 2019

[root@mydevops opc]# hostnamectl
Static hostname: guo-instance-20190911-1434
Transient hostname: mydevops
Icon name: computer-vm
Chassis: vm
Machine ID: 98a78d7d0dfb407b8c21c6cc39088f74
Boot ID: e7c9904fd1304d0da61ed675f2a2f21a
Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-957.27.2.el7.x86_64
Architecture: x86-64
[root@mydevops opc]#

[root@mydevops opc]# uname -a
Linux mydevops 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

[root@mydevops opc]# dmesg | grep "Linux"
[ 0.000000] Linux version 3.10.0-957.27.2.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Mon Jul 29 17:46:05 UTC 2019
[ 0.602881] SELinux: Initializing.
[ 0.604016] SELinux: Starting in permissive mode
[ 0.918180] ACPI: Added _OSI(Linux-Dell-Video)
[ 2.054186] SELinux: Registering netfilter hooks
[ 2.129185] Linux agpgart interface v0.103

[root@mydevops opc]# yum repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.ash.fastserv.com
* epel: d2lzkl7pfhq30w.cloudfront.net
* extras: mirror.ash.fastserv.com
* updates: packages.oit.ncsu.edu
repo id repo name status
base/7/x86_64 CentOS-7 - Base 10,019
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,384
extras/7/x86_64 CentOS-7 - Extras 435
updates/7/x86_64 CentOS-7 - Updates 2,500
repolist: 26,338

 

You might also like:

Sidebar



back to top