檢視linux系統版本號命令

2021-09-06 18:31:02 字數 2765 閱讀 3903

一。檢視核心版本號命令:

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) 登入到server執行 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 ~]#

Ubuntu檢視linux系統版本號

檢視ubuntu版本 輸入命令 cat proc version 顯示如下 linux version 5.0.0 13 generic buildd lcy01 amd64 020 linux核心版本號 gcc version 8.3.0 gcc編譯器版本號 ubuntu 8.3.0 6ubunt...

linux 檢視當前系統版本號

為避免現場未能完全安裝系統,使用yum 安裝版本需一致 第一種方法 root sky9896sky lsb release a bash lsb release command not found root sky9896sky yum install lsb y root sky9896sky l...

檢視系統版本號 Redhat

一 檢視linux核心版本命令 兩種方法 1 cat proc version root localhost cat proc version linux version 2.6.18 194.8.1.el5.centos.plus mockbuild builder17.centos.org gc...