檢視Linux版本資訊

2021-09-07 23:43:14 字數 3931 閱讀 3096

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

1:more /etc/issue 命令檢視

1.1 oracle linux

[root@db-server ~]# more /etc/issue
oracle linux server release 5.7
kernel \r on an \m

1.2 centos linux

[root@centos2 ~]# more /etc/issue
centos release 6.4 (final)
kernel \r on an \m

1.3 redhat linux

[root@getlnx05 ~]# more /etc/issue
red hat enterprise linux server release 5.7 (tikanga)
kernel \r on an \m

2: lsb_release -a 命令檢視

2.1 oracle linux

[root@db-server ~]# 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: enterpriseenterpriseserver
description:    enterprise linux enterprise linux server release 5.7 (carthage)
release:        5.7
codename:       carthage

2.2 centos linux

[root@centos2 ~]#  lsb_release -a
lsb version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
distributor id: centos
description:    centos release 6.4 (final)
release:        6.4
codename:       final

2.3 redhat linux

[root@getlnx05 ~]#  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: redhatenterpriseserver
description:    red hat enterprise linux server release 5.7 (tikanga)
release:        5.7
codename:       tikanga

3:cat /etc/redhat-release 命令檢視

這個命令應該只有部分linux可以檢視,不是所有版本linux都可以使用該命令

3.1 oracle linux

[root@db-server ~]# cat /etc/redhat-release
red hat enterprise linux server release 5.7 (tikanga)
[root@db-server etc]# cat /etc/*release
enterprise linux enterprise linux server release 5.7 (carthage)
oracle linux server release 5.7
red hat enterprise linux server release 5.7 (tikanga)
[root@db-server etc]# ls  /etc/*lease
/etc/enterprise-release  /etc/oracle-release  /etc/redhat-release
[root@db-server etc]#

3.2 centos linux

[root@centos2 ~]# cat /etc/redhat-release
centos release 6.4 (final)
[root@centos2 ~]# cat /etc/*release
centos release 6.4 (final)
lsb_version=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
centos release 6.4 (final)
centos release 6.4 (final)
[root@centos2 ~]# ls /etc/*release
/etc/centos-release  /etc/lsb-release  /etc/redhat-release  /etc/system-release
[root@centos2 ~]#

3.3 redhat linux

[root@getlnx05 ~]# cat /etc/redhat-release
red hat enterprise linux server release 5.7 (tikanga)
[root@getlnx05 ~]# cat /etc/*release
red hat enterprise linux server release 5.7 (tikanga)
[root@getlnx05 ~]# ls /etc/*release
/etc/redhat-release
[root@getlnx05 ~]#

4 rpm -q redhat-release命令檢視,只適用於redhat linux

[root@getlnx05 ~]# rpm -q redhat-release
redhat-release-5server-5.7.0.3

檢視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 ...