檢視linux系統版本命令

2021-06-26 20:31:58 字數 2739 閱讀 5764

一。檢視核心版本命令:

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系統版本命令

1.檢視核心版本命令 1 root q1test01 cat proc version linux version 2.6.9 22.elsmp bhcompile crowe.devel.redhat.com gcc version 3.4.4 20050721 red hat 3.4.4 2 1...

檢視linux系統版本命令

一。檢視核心版本命令 1 root sor sys cat proc version linux version 2.6.18 238.el5 mockbuild x86 012.build.bos.redhat.com gcc version 4.1.2 20080704 red hat 4.1....

檢視linux系統版本命令

一。檢視核心版本命令 1 root sor sys cat proc version linux version 2.6.18 238.el5 mockbuild x86 012.build.bos.redhat.com gcc version 4.1.2 20080704 red hat 4.1....