查看Linux系统版本信息的方法小结

页面导航:首页 > 操作系统 > LINUX > 查看Linux系统版本信息的方法小结

查看Linux系统版本信息的方法小结

来源: 作者: 时间:2015-12-01 17:20 【

这篇文章主要介绍了查看Linux系统版本信息的方法小结,主要针对RedHat系的Linux的命令,需要的朋友可以参考下
这篇文章主要介绍了查看Linux系统版本信息的方法小结,主要针对RedHat系的Linux的命令,需要的朋友可以参考下
如何查看Linux系统使用的版本信息呢? 下面这篇文章收集、整理了一些常见的查看Linux系统版本的方法。由于手头只有Oracle Linux、Centos Linux、Redhat Linux三个版本Linux,所以像Debian、Ubuntu之类的Linux系统,下面方法在这些版本都没测试过。

1:more /etc/issue 命令查看

1.1 Oracle Linux


复制代码
代码如下:

[[email protected] ~]# more /etc/issueOracle Linux Server release 5.7Kernel \r on an \m


1.2 Centos Linux
 

复制代码
代码如下:

[[email protected] ~]# more /etc/issueCentOS release 6.4 (Final)Kernel \r on an \m
 

1.3 RedHat Linux
 

复制代码
代码如下:

[[email protected] ~]# more /etc/issueRed Hat Enterprise Linux Server release 5.7 (Tikanga)Kernel \r on an \m
 

2: lsb_release -a 命令查看 

2.1 Oracle Linux


复制代码
代码如下:

[[email protected] ~]# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)
Release: 5.7
Codename: Carthage

2.2 Centos Linux

复制代码
代码如下:

[[email protected] ~]# lsb_release -a
LSB Version: :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
Distributor ID: CentOS
Description: CentOS release 6.4 (Final)
Release: 6.4
Codename: Final

2.3 RedHat Linux

复制代码
代码如下:

[[email protected] ~]# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.7 (Tikanga)
Release: 5.7
Codename: Tikanga

3:cat /etc/redhat-release 命令查看

这个命令应该只有部分Linux可以查看,不是所有版本Linux都可以使用该命令

3.1 Oracle Linux

复制代码
代码如下:

[[email protected] ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)

[[email protected] etc]# cat /etc/*release
Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)
Oracle Linux Server release 5.7
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
[[email protected] etc]# ls /etc/*lease
/etc/enterprise-release /etc/oracle-release /etc/redhat-release
[[email protected] etc]#

3.2 Centos Linux

复制代码
代码如下:

[[email protected] ~]# cat /etc/redhat-release
CentOS release 6.4 (Final)

[[email protected] ~]# cat /etc/*release
CentOS release 6.4 (Final)
LSB_VERSION=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
CentOS release 6.4 (Final)
CentOS release 6.4 (Final)
[[email protected] ~]# ls /etc/*release
/etc/centos-release /etc/lsb-release /etc/redhat-release /etc/system-release
[[email protected] ~]#

3.3 RedHat Linux

复制代码
代码如下:

[[email protected] ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)

[[email protected] ~]# cat /etc/*release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
[[email protected] ~]# ls /etc/*release
/etc/redhat-release
[[email protected] ~]#

4 rpm -q redhat-release命令查看,只适用于Redhat Linux

复制代码
代码如下:

[[email protected] ~]# rpm -q redhat-release
redhat-release-5Server-5.7.0.3
Tags:

文章评论

最 近 更 新
热 点 排 行
Js与CSS工具
代码转换工具

<