--Check the contents of commands and files to check the version of CentOS Linux or Linux kernel
/etc/centos-release
$ cat /etc/centos-release
CentOS Linux release 8.1.1911 (Core)
/etc/centos-release-upstream
$ cat /etc/centos-release-upstream
Derived from Red Hat Enterprise Linux 8.1 (Source)
/etc/os-release
$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"
/etc/system-release-cpe
$ cat /etc/system-release-cpe
cpe:/o:centos:centos:8
The version information is listed in the file around here. Many are symbolically linked.
$ ls -l /etc/ | grep release
-rw-r--r--1 root root 38 March 13 04:15 centos-release
-rw-r--r--1 root root 51 March 13 04:15 centos-release-upstream
lrwxrwxrwx 1 root root 21 March 13 04:15 os-release -> ../usr/lib/os-release
lrwxrwxrwx 1 root root 14 March 13 04:15 redhat-release -> centos-release
lrwxrwxrwx 1 root root 14 March 13 04:15 system-release -> centos-release
-rw-r--r--.1 root root 23 March 13 04:15 system-release-cpe
$ uname -m
x86_64
$ uname -o
GNU/Linux
$ uname -r
4.18.0-147.5.1.el8_1.x86_64
$ uname -s
Linux
$ uname -v
#1 SMP Wed Feb 5 02:00:39 UTC 2020
$ uname -morsv
Linux 4.18.0-147.5.1.el8_1.x86_64 #1 SMP Wed Feb 5 02:00:39 UTC 2020 x86_64 GNU/Linux
$ uname -a
Linux foo.example.com 4.18.0-147.5.1.el8_1.x86_64 #1 SMP Wed Feb 5 02:00:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 8.1.1911 (Core)
Release: 8.1.1911
Codename: Core
The lsb_release command is included in the redhat-lsb-core package, so install it with dnf install redhat-lsb-core if necessary.
hostnamectl
$ hostnamectl
Static hostname: foo.example.com
Icon name: computer-vm
Chassis: vm
Machine ID: 11112222333344445555666677778888
Boot ID: ffffeeeeddddccccbbbbaaaa00009999
Virtualization: kvm
Operating System: CentOS Linux 8 (Core)
CPE OS Name: cpe:/o:centos:centos:8
Kernel: Linux 4.18.0-147.5.1.el8_1.x86_64
Architecture: x86-64
-Red Hat Enterprise Linux Release Date and List of Included Kernels -Red Hat Customer Portal
Recommended Posts