查看Linux版本資訊命令詳解

來源:互聯網
上載者:User


下面分別是如何查看核心版本、核心具體資訊、Linux版本資訊。

cat /proc/version

lsb_release -a

uname -a

cat /etc/issue

cat /etc/redhat-release


1、cat /proc/version

Linux version 2.6.18-194.el5 (mockbuild@builder16.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Fri Apr 2 14:58:35 EDT 2010

 

2、lsb_release -a

LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description: CentOS release 5.5 (Final)
Release: 5.5
Codename: Final

 

3、uname -a

Linux centos 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 i686 i686 i386 GNU/Linux

 

4、cat /etc/issue

CentOS release 5.5 (Final)
Kernel r on an m

 

5、cat /etc/redhat-release

CentOS release 5.5 (Final)

 
LSB是Linux Standard Base的縮寫,lsb_release命令用來顯示LSB和特定版本的相關資訊。如果使用該命令時不帶參數,則預設加上-v參數。

-v, --version
顯示版本資訊

-i, --id
顯示發行版的ID

-d, --description
顯示該發行版的描述資訊

-r, --release
顯示當前系統是發行版的具體版本號碼

-c, --codename
發行版代號

-a, --all
顯示上面的所有資訊

-h, --help
顯示協助資訊

如果當前發行版是LSB相容的,那麼“/etc/lsb_release”檔案中會包含LSB_VERSION域。這個域的值可以是用冒號隔開的一系列支援的模組。這些模組名是目前的版本支援的LSB的模組名。如果目前的版本不是LSB相容的,就不要包含這個域。

可選的域包括DISTRIB_ID, DISTRIB_RELEASE, DISTRIB_CODENAME, DISTRIB_DESCRIPTION,它們可以覆蓋/etc/distrib-release檔案中的內容。註:這裡的distrib要替換為當前的 發行版的名字。

如果存在/etc/lsb-release.d目錄,會在該目錄中尋找檔案名稱並作為附加的模組版本加在LSB_VERSION前面。檔案/etc/distrib-release中包含了一些描述資訊,用來說明應該分析哪些檔案名稱。

一般的格式是:"Distributor release x.x (Codename)"

注意:Debian系統中缺乏相應的描述資訊(見/etc/debian-version),為了支援Debian系統,大部分資訊都被加在了lsb-release檔案中。

redhat和fedora系統中,還支援一個參數:
-s, --short
輸出簡短的描述資訊

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.