您的位置首页百科问答

Linux CentOS 7.5 如何查看操作系统版本

Linux CentOS 7.5 如何查看操作系统版本

的有关信息介绍如下:

Linux CentOS 7.5 如何查看操作系统版本

Linux CentOS 7.5 如何查看操作系统版本

[root@localhost ~]# cat /etc/redhat-release

CentOS Linux release 7.5.1804 (Core)

该命令适用于 redhat 及其衍生发行版本,如 CentOS、中标麒麟等。

[root@localhost ~]# cat /etc/system-release

CentOS Linux release 7.5.1804 (Core)

CentOS 7.5 操作系统默认没有 lsb_release 这个命令,这个命令属于软件包 redhat-lsb-core,需要安装该软件包。

yum install -y redhat-lsb-core

使用 yum 安装 redhat-lsb-core 软件包。

[root@localhost ~]# lsb_release -d

Description: CentOS Linux release 7.5.1804 (Core)

uname 命令可以查看操作系统内核版本等信息,但不能查看操作系统版本。

[root@localhost ~]# uname -a

Linux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

[root@localhost ~]# uname -r

3.10.0-862.el7.x86_64

[root@localhost ~]# cat /proc/version

Linux version 3.10.0-862.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) ) #1 SMP Fri Apr 20 16:44:24 UTC 2018

cat /proc/version 只能看到操作系统内核版本等信息,并不能直接看到操作系统版本信息。

[root@localhost ~]# cat /etc/centos-release

CentOS Linux release 7.5.1804 (Core)

该命令仅适用于 CentOS 系列发行版本。