[linux] 查看centos或ubuntu的系统版本

2021-07-23 10:26:27 浏览数 (1)

centos版本

cat /etc/redhat-release

代码语言:javascript复制
[root@iZt4nfi13rgw5yqxf67k84Z ~]# cat  /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
代码语言:javascript复制
[root@iZt4nfi13rgw5yqxf67k84Z ~]# lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.9.2009 (Core)
Release:        7.9.2009
Codename:       Core

ubuntu版本

lsb_release -a

代码语言:javascript复制
root@VM-0-4-ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:        16.04
Codename:       xenia
代码语言:javascript复制
[root@iZt4nfi13rgw5yqxf67k84Z ~]# cat /proc/version
Linux version 3.10.0-1160.31.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Thu Jun 10 13:32:12 UTC 2021

0 人点赞