查看CentOS7内核版本及发行版本

1.查看内核版本
$ uname -sr
Linux 4.15.11-1.el7.elrepo.x86_64


$ uname -a
Linux localhost.localdomain 4.15.11-1.el7.elrepo.x86_64 #1 SMP Mon Mar 19 11:46:06 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux


$ cat /proc/version
Linux version 4.15.11-1.el7.elrepo.x86_64 (mockbuild@Build64R7) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)) #1 SMP Mon Mar 19 11:46:06 EDT 2018

2.查看发行版本

#适用于所有linux发行版本

$ yum install -y redhat-lsb-core
$  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.4.1708 (Core)
Release:        7.4.1708
Codename:       Core

#查看ubuntu发行版本

$ apt-get install lsb-core

$ lsb_release -a
LSB Version:    core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04
Codename:       bionic

#仅适用于redhat系列linux
$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

你可能感兴趣的:(Linux)