檢視Linux各種版本資訊

2021-07-22 07:19:20 字數 2739 閱讀 7578

一。檢視核心版本命令:

1) [root@sor_sys ~]# cat /proc/version

linux version 2.6.18-238.el5 ([email protected]) (gcc version 4.1.2 20080704 (red hat 4.1.2-50)) #1 smp sun dec 19 14:22:44 est 2010

[root@sor_sys ~]#

2)[root@sor_sys ~]# uname -r

2.6.18-238.el5

3)[root@sor_sys ~]# uname -a

linux sor_sys.99bill.com 2.6.18-238.el5 #1 smp sun dec 19 14:22:44 est 2010 x86_64 x86_64 x86_64 gnu/linux

[root@sor_sys ~]#

二。檢視linux版本:

1) 登入到伺服器執行 lsb_release -a ,即可列出所有版本資訊,例如:

[root@sor_sys ~]# 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: redhatenterpriseas

description:    red hat enterprise linux as release 4 (nahant update 4)

release:        4

codename:       nahantupdate4

[root@sor_sys ~]#

注:這個命令適用於所有的linux,包括redhat、suse、debian等發行版。

2) 登入到linux執行cat /etc/issue,例如如下:

[root@sor_sys ~]# cat /etc/issue

red hat enterprise linux server release 5.6 (tikanga)

kernel \r on an \m

[root@sor_sys ~]#

3) 登入到linux執行cat /etc/redhat-release ,例如如下:

[root@sor_sys ~]# cat /etc/redhat-release

red hat enterprise linux as release 4 (nahant update 4)

[root@sor_sys ~]#

注:這種方式下可以直接看到具體的版本號,比如 as4 update 1

4)登入到linux執行rpm -q redhat-release ,例如如下:

[root@sor_sys ~]# rpm -q redhat-release

redhat-release-5server-5.6.0.3

[root@sor_sys ~]#

注:這種方式下可看到乙個所謂的release號,比如上邊的例子是5

這個release號和實際的版本之間存在一定的對應關係,如下:

redhat-release-3as-1 -> redhat enterprise linux as 3

redhat-release-3as-7.4 -> redhat enterprise linux as 3 update 4

redhat-release-4as-2 -> redhat enterprise linux as 4

redhat-release-4as-2.4 -> redhat enterprise linux as 4 update 1

redhat-release-4as-3 -> redhat enterprise linux as 4 update 2

redhat-release-4as-4.1 -> redhat enterprise linux as 4 update 3

redhat-release-4as-5.5 -> redhat enterprise linux as 4 update 4

另:第3)、4)兩種方法只對redhat linux有效

5) [root@sor_sys ~]# file /bin/bash

/bin/bash: elf 64-bit lsb executable, amd x86-64, version 1 (sysv), for gnu/linux 2.6.9, dynamically linked (uses shared libs), for gnu/linux 2.6.9, stripped

[root@sor_sys ~]#

6) [root@sor_sys ~]# file /bin/cat 

/bin/cat: elf 64-bit lsb executable, amd x86-64, version 1 (sysv), for gnu/linux 2.6.9, dynamically linked (uses shared libs), for gnu/linux 2.6.9, stripped

[root@sor_sys ~]#

檢視linux版本資訊

幾種檢視linux版本資訊的方法 uname a cat proc version cat etc issue lsb release a 詳解 lsb release a 登入到伺服器執行 lsb release a 即可列出所有版本資訊,例如 root 3.5.5biz 46 lsb relea...

linux 檢視版本資訊

1 uname a linux檢視版本當前作業系統核心資訊 linux ml 4.4.0 109 generic 132 ubuntu smp tue jan 9 19 52 39 utc 2018 x86 64 x86 64 x86 64 gnu linux 2 cat proc version ...

檢視Linux版本資訊

如何檢視linux系統使用的版本資訊呢?下面這篇文章收集 整理了一些常見的檢視linux系統版本的方法。由於手頭只有oracle linux centos linux redhat linux三個版本linux,所以像debian ubuntu之類的linux系統,下面方法在這些版本都沒測試過。1 ...