Commands to Show CentOS Version – Quick Guide


 

 

When you are working in CentOS server, it is very much important to monitor the  There are many ways to check your CentOS version. Wish to check out your CentOS version running on your current system? Then you are in the right place. You can use so many command-line such as rpm, cat and so on… This can be applied to all the Linux releases like Ubuntu, Red Hat, Debian and with Unix OS. Follow the given commands to show CentOS Versions running in your system.

See also: How to install CentOS web panel?

How to show CentOS Version in different commands?

I have listed all the types of commands here. Use all the below tricks and get CentOS Version for other operations.

Method 1: Use uname command

An easy way to inspect the Kernel version is by using Uname known as Unix name. You can easily get all the information (user name, kernel version and much more) about your working system by uname command.

uname –a

Output will be as follows,

Linux office.ubuntumag.net 2.6.32-220.2.1.el6.x86_64 #1 SMP
Fri Dec 23 02:21:33 CST 2011 ×86_64 ×86_64 ×86_64 GNU/Linux

Get further information using the below uname commands

-a, –all print all information
-s, –kernel-name        print the kernel name
-n, –nodename print the network node hostname
-r, –kernel-release     print the kernel release
-v, –kernel- version  print the kernel version
-m, –machine print the machine hardware name
-p, –processor print the processor type or “unknown”
-i, –hardware-platform print the hardware platform or “unknown”
-o, –operating-system print the operating system
–help display this help and exit
–version output version information and exit

You can also check the System architecture details by using # uname -m

Method 2: Check using rpm command

# rpm --query centos-release

centos-release-7-1.1503.el7.centos.2.8.x86_64

Method 3: Check using Hostnamectl command

You can just configure your host name and its associated settings by using this hostnamectl command.

Host name $ hostnamectl

— OR —

$ hostnamectl status

Static Host Name is saved in Kernel. It can be viewed by

/etc/hostname

Copy & paste the below hostnamectl code

# hostnamectl

   Static hostname: localhost.localdomain

         Icon name: computer-laptop

           Chassis: laptop

        Machine ID: 6892999b8d8c43fab29fca961dbff24b

           Boot ID: b0a95bf56f61417ca8073b3847a73ab1

  Operating System: CentOS Linux 7 (Core)

       CPE OS Name: cpe:/o:centos:centos:7

            Kernel: Linux 3.10.0-229.7.2.el7.x86_64

      Architecture: x86_64

Method 4: Check using cat command

To show Kernel information for the running machine, Use the below code to know get your version correctly.

 # cat /etc/centos-release

CentOS Linux release 7.1.1503 (Core)

# cat /etc/os-release

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"
# cat /etc/redhat-release

CentOS Linux release 7.1.1503 (Core)
# cat /etc/system-release

CentOS Linux release 7.1.1503 (Core)

Check the following commands to show CentOS Version Numbers:

  • /etc/centos-release
  • /etc/os-release
  • /etc/redhat-release
  • /etc/system-release

See Also: How to Install Hadoop 2.7.1 on CentOS/Linux/Ubuntu?

Method 5: Check using lsb_release command

Lsb_release command is a portion of Red Hat called as redhat-lsb package. Your system will not have “Linux Standard Base” command by default.

lsb_release – to show Distribution Specific Information.

Use some alternative tactics to check CentOS version by lsb_release command as follows:

# lsb_release -d

Description: CentOS Linux release 7.1.1503 (Core)

You can also use the below command for checking Kernel version using lsb command.

Install lsb packages by Red Hat from its base warehouse by using the below code.

# yum install redhat-lsb-core

— OR —

# yum install redhat-lsb

Now use this below command for showing CentOS version

# 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.4 (Final)

Release:        6.4

Codename:       Final

That’s it. Hope you got all the information from your kernel. If you have any other ideas and allusions feel free to comment us below…

2:19 pm