ubuntu centos show version hostnamectl , lsb_release -a , rpm --query centos-release

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


-----------------------------

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"

#lsb_release -a 
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: Xenial

Yet, another alternative is to use lsb_release command. However, this command is part of redhat-lsbpackage and is not installed by default so the actual lsb_release command may be unavailable on your system.
----------------------------------------------------------
The next example uses rpm command to do query for centos-release package to reveal CentOS version:
# rpm --query centos-release
centos-release-7-1.1503.el7.centos.2.8.x86_64

Comments

Popular posts from this blog

HAproxy logging

teamcity Automatic Agent Start under Linux

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all