下面三个命令都可以查看linux操作系统的版本信息
cat /etc/os-release
lsb_release -a
hostnamectl
cat /etc/os-release
[test@test01 ~]$cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="7.4"
ID="ol"
VERSION_ID="7.4"
PRETTY_NAME="Oracle Linux Server 7.4"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:7:4:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
ORACLE_BUGZILLA_PRODUCT_VERSION=7.4
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=7.4
lsb_release -a
[test@test01 ~]$ lsb_release -a
LSB Version::core-4.1-amd64:core-4.1-ia32:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-ia32:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-ia32:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID:OracleServer
Description:Oracle Linux Server release 7.4
Release:7.4
Codename:n/a
hostnamectl
[test@test01 ~]$ hostnamectl
Static hostname: test01
Icon name: computer-vm
Chassis: vm
Machine ID: ed1297468c6e49359d209d23ff40cf52
Boot ID: 90bd22f0fec64d46840c3c33b02951a6
Virtualization: xen
Operating System: Oracle Linux Server 7.4
CPE OS Name: cpe:/o:oracle:linux:7:4:server
Kernel: Linux 4.1.12-124.19.2.el7uek.x86_64
Architecture: x86-64
uname -r 可以查看Linux kernel version:
[test@test01 ~]$ uname -r
4.1.12-124.19.2.el7uek.x86_64