溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

Linux下怎么查看版本信息

發(fā)布時(shí)間:2022-01-26 09:18:47 來(lái)源:億速云 閱讀:156 作者:小新 欄目:開(kāi)發(fā)技術(shù)

這篇文章給大家分享的是有關(guān)Linux下怎么查看版本信息的內(nèi)容。小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過(guò)來(lái)看看吧。


lsb_release

顯示LSB(Linux Standard Base)兼容的發(fā)行版本信息。如果是LSB兼容的發(fā)行版本,在/etc/lsb-release就可以查看到具體的版本信息。

Linux下怎么查看版本信息
Linux中查看版本信息命令介紹Linux中查看版本信息命令介紹

lsb_release可以快速過(guò)濾這些信息找到自己需要的字段,這個(gè)命令有可能沒(méi)有自帶,可以自行安裝lsb-release包就可以有了。

lsb_release -h
FSG lsb_release v1.4 prints certain LSB (Linux Standard Base) and
Distribution information.

Usage: lsb_release [OPTION]...
With no OPTION specified it is the same as -v.

Options:
 -v, --version
   Display the version of the LSB specification against which the distribution is compliant.
 -i, --id
   Display the string id of the distributor.
 -d, --description
   Display the single line text description of the distribution.
 -r, --release
   Display the release number of the distribution.
 -c, --codename
   Display the codename according to the distribution release.
 -a, --all
   Display all of the above information.
 -s, --short
   Display all of the above information in short output format.
 -h, --help   Display this message.
lsb_release -a
LSB Version:    n/a
Distributor ID: ManjaroLinux
Description:    Manjaro Linux
Release:    21.0.2
Codename:   Ornara

Version文件

lsb_release這個(gè)命令需要有另外安裝,如果沒(méi)有安裝也可以通過(guò)其他的版本信息文件找到版本的信息。

RHEL系列:/etc/redhat-release、/etc/os-release、/etc/system-release 等,這些文件一般都是指向同一個(gè)文件,如果是重新發(fā)行的版本,例如centos,還會(huì)有/etc/centos-release

Debian系列:/etc/debian-version、/etc/issue等,同樣重新發(fā)行的版本也會(huì)有對(duì)應(yīng)的version文件。

Linux下怎么查看版本信息
Linux中查看版本信息命令介紹Linux中查看版本信息命令介紹

內(nèi)核版本

查看內(nèi)核版本一般都使用uname這個(gè)命令。

uname -a
Linux manjaro 5.11.14-1-MANJARO #1 SMP PREEMPT Wed Apr 14 08:25:29 UTC 2021 x86_64 GNU/Linux

用這個(gè)命令也可以快速過(guò)濾到自己需要的字段。

也可以直接查看/proc/version來(lái)查看當(dāng)前云中的內(nèi)核版本

cat /proc/version
Linux version 5.11.14-1-MANJARO (builduser@LEGION) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils

感謝各位的閱讀!關(guān)于“Linux下怎么查看版本信息”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI