查看系统版本--Centos7

Centos7 查看系统版本

本文主要讲解如何查看 linux 内核版本及 linux 发行版(Redhat)

  1. 查看内核版本

    1.1 uname命令

    
    [root@local ~]# uname -a  //显示版本及相关内容
    
    	Linux local 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 
    x86_64 GNU/Linux
    	
    [root@local ~]# uname -r //只显示版本信息
    
    	3.10.0-862.el7.x86_64
    
    

    1.2 绝对路径 /proc/version

    [root@local ~]# cat /proc/version
    
    	Linux version 3.10.0-862.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4
    .8.520150623 (Red Hat 4.8.5-28) (GCC) ) #1 SMP Fri Apr 20 16:44:24 UTC 2018
    
    
  2. 查看发行版本

    2.1 lsb-release 命令

    ps:如无此命令,请先安装yum -y redhat-lsb

    
    [root@local ~]# lsb_release -a
    --------省略-------
    Distributor ID:	CentOS
    Description:	CentOS Linux release 7.5.1804 (Core) 
    Release:	7.5.1804
    Codename:	Core
    
    

    2.2 使用绝对路径

    • /etc/os-release
    • /etc/redhat-release
    
    [root@local ~]# cat /etc/redhat-release
    
    CentOS Linux release 7.5.1804 (Core) 
    
    

你可能感兴趣的:(CentOS7)