欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

查看CentOS 发行版的名称及其版本号

程序员文章站 2022-03-05 10:17:23
...

一、查看CentOS内核版本命令(两种方法):

1、cat /proc/version

[[email protected] ~]# cat /proc/version
Linux version 3.10.0-862.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) ) #1 SMP Fri Apr 20 16:44:24 UTC 2018

2、uname -a

[[email protected] ~]# uname -a
Linux bj-rack001-hadoop001 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

二、查看CentOS系统版本的命令(2种方法):


1、lsb_release -a,即可列出所有版本信息:

[[email protected] ~]# lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID:	CentOS
Description:	CentOS Linux release 7.5.1804 (Core) 
Release:	7.5.1804
Codename:	Core

 

 

2、cat /etc/redhat-release,这种方法只适合Redhat系的Linux:

[[email protected] ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)