如何查看 linux 内核版本及 linux 发行版(redhat)
查看内核版本
1.1 uname命令
[root@local ~]# uname -a //显示版本及相关内容
linux local 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@local ~]# uname -r //只显示版本信息
3.10.0-862.el7.x86_64
1.2 绝对路径 /proc/version
[root@local ~]# cat /proc/version
linux version 3.10.0-862.el7.x86_64 ([email protected]) (gcc version 4
.8.520150623 (red hat 4.8.5-28) (gcc) ) #1 smp fri apr 20 16:44:24 utc 2018
查看发行版本
2.1 lsb-release 命令
ps:如无此命令,请先安装yum -y redhat-lsb
[root@local ~]# lsb_release -a
--------省略-------
distributor id: centos
description: centos linux release 7.5.1804 (core)
release: 7.5.1804
codename: core
2.2 使用绝对路径
/etc/os-release
/etc/redhat-release
[root@local ~]# cat /etc/redhat-release
centos linux release 7.5.1804 (core)