zoukankan      html  css  js  c++  java
  • 查看Linux版本信息

    如何查看Linux系统使用的版本信息呢? 下面这篇文章收集、整理了一些常见的查看Linux系统版本的方法。由于手头只有Oracle Linux、Centos Linux、Redhat Linux三个版本Linux,所以像Debian、Ubuntu之类的Linux系统,下面方法在这些版本都没测试过。

     

    1:more /etc/issue 命令查看

    1.1 Oracle Linux

     
    [root@DB-Server ~]# more /etc/issue
    Oracle Linux Server release 5.7
    Kernel 
     on an m

     

    1.2 Centos Linux

    [root@Centos2 ~]# more /etc/issue
    CentOS release 6.4 (Final)
    Kernel 
     on an m

     

    1.3 RedHat Linux

    [root@getlnx05 ~]# more /etc/issue
    Red Hat Enterprise Linux Server release 5.7 (Tikanga)
    Kernel 
     on an m

     

    2: lsb_release -a 命令查看

     

    2.1 Oracle Linux

    [root@DB-Server ~]# 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

    clip_image001

     

    2.2 Centos Linux

    [root@Centos2 ~]#  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

    clip_image002

     

    2.3 RedHat Linux

    [root@getlnx05 ~]#  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

    clip_image003

     

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

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

    3.1 Oracle Linux

    [root@DB-Server ~]# cat /etc/redhat-release 
    Red Hat Enterprise Linux Server release 5.7 (Tikanga)
     
    [root@DB-Server 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)
    [root@DB-Server etc]# ls  /etc/*lease
    /etc/enterprise-release  /etc/oracle-release  /etc/redhat-release
    [root@DB-Server etc]# 

     

    3.2 Centos Linux

    [root@Centos2 ~]# cat /etc/redhat-release 
    CentOS release 6.4 (Final)
     
    [root@Centos2 ~]# 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)
    [root@Centos2 ~]# ls /etc/*release
    /etc/centos-release  /etc/lsb-release  /etc/redhat-release  /etc/system-release
    [root@Centos2 ~]# 

    clip_image004

     

    3.3 RedHat Linux

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

    clip_image005

     

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

    [root@getlnx05 ~]# rpm -q redhat-release
     
    redhat-release-5Server-5.7.0.3
  • 相关阅读:
    http 请求code状态码
    uni-app实现弹窗遮罩
    小程序分享报错 Cannot read property 'apply' of null;at page XXX onShareAppMessage function
    mac下出现xcrun: error导致git、svn无法使用的解决办法
    uniapp 小程序实现自定义底部导航栏(tarbar)
    Python2.X和Python3.X中Tkinter模块的文件对话框、下拉列表的不同
    Mac 设置git的template
    每天一点点之vue框架开发
    uni-app开发小程序-使用uni.switchTab跳转后页面不刷新的问题
    小程序实现微信朋友圈时间显示效果
  • 原文地址:https://www.cnblogs.com/kerrycode/p/4315900.html
Copyright © 2011-2022 走看看