1. 程式人生 > >檢視系統版本--Centos7

檢視系統版本--Centos7

Centos7 檢視系統版本

本文主要講解如何檢視 linux 核心版本及 linux 發行版(Redhat)

  1. 檢視核心版本

    1.1 uname命令

    
    [[email protected] ~]# 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
    	
    [[email protected] ~]# uname -r //只顯示版本資訊
    
    	3.10.0-862.el7.x86_64
    
    

    1.2 絕對路徑 /proc/version

    [[email protected] ~]# cat /proc/version
    
    	Linux version 3.10.0-862.el7.x86_64 ([email protected].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

    
    [[email protected] ~]# 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
    
    [[email protected] ~]# cat /etc/redhat-release
    
    CentOS Linux release 7.5.1804 (Core)