查看linux系统版本的方法

原文 https://blog.csdn.net/aoril/article/details/53518917

 

OS:CentOS release 6.7 (Final)

第一种方法:

[root@sky9896sky]# lsb_release -a

bash:lsb_release: command not found

[root@sky9896sky]#yum install lsb –y

[root@sky9896sky]# lsb_release -a

LSBVersion:   :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch

DistributorID: CentOS

Description:    CentOS release 6.7 (Final)

Release:        6.7

Codename:       Final

第二种方法:

[root@sky9896 sky]# cat /etc/redhat-release

CentOSrelease 6.7 (Final)

第三种方法:

[root@sky9896 sky]# rpm -qcentos-release

centos-release-6-7.el6.centos.12.3.x86_64

第四种方法:

[root@sky9896 sky]# cat/etc/issue

    依据实际情况确定选用那种方法,并不是每一种方法都会有效果,建议采用第一、二种方法。

posted @ 2018-04-10 11:48  杨博客  阅读(94)  评论(0编辑  收藏  举报