CentOS檢視版本號

2021-07-23 07:25:44 字數 2522 閱讀 6127

centos檢視版本號,最合適的命令為:

cat /etc/redhat-release

以下為測試過程:

1.      cat /etc/redhat-release

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

centos linux release 7.2.1511 (core)

2.      lsb_release

命令沒找到

3.      uname -a

[root@localhost ~]# uname -a

linux localhost.localdomain3.10.0-327.el7.x86_64 #1 smp thu nov 19 22:10:57 utc 2015 x86_64 x86_64 x86_64gnu/linux

4.      cat /proc/version

[root@localhost ~]# cat /proc/version

linux version 3.10.0-327.el7.x86_64([email protected]) (gcc version 4.8.3 20140911 (red hat 4.8.3-9)(gcc) ) #1 smp thu nov 19 22:10:57 utc 2015

參考:如何檢視已安裝的centos版本資訊

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

linux version 2.6.18-194.el5 ([email protected]) (gcc version 4.1.2 20080704 (red hat 4.1.2-48)) #1 smp fri apr 2 14:58:14 edt 2010

2)[root@localhost ~]# uname -a

linux localhost.localdomain 2.6.18-194.el5 #1 smp fri apr 2 14:58:14 edt 2010 x86_64 x86_64 x86_64 gnu/linux

3)[root@localhost ~]# uname -r

2.6.18-194.el5

2. 檢視linux版本:

1) 列出所有版本資訊,

[root@localhost ~]# lsb_release -a

lsb version:    :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch

distributor id: centos

description:    centos release 5.5 (final)

release:        5.5

codename:      final

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

2) 執行cat /etc/issue,例如如下:

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

centos release 5.5 (final)

kernel r on an m

3) 執行cat /etc/redhat-release ,例如如下:

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

centos release 5.5 (final)

檢視系統是64位還是32位:

1、getconf long_bit or getconf word_bit

[root@localhost ~]# getconf long_bit

2、file /bin/ls

[root@localhost ~]# file /bin/ls

/bin/ls: 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

3、lsb_release  -a

[root@localhost ~]# lsb_release -a

lsb version:    :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch

distributor id: centos

description:    centos release 5.5 (final)

release:        5.5

codename:      final

4、或者是使用檢視檔案的方法。

vim /ect/issue

CentOS檢視核心版本,位數,版本號

1 root localhost cat proc version linux version 2.6.18 194.el5 mockbuild builder10.centos.org gcc version 4.1.2 20080704 red hat 4.1.2 48 1 smp fri ap...

檢視ubuntu版本號

方法一 cat etc issue 返回結果 ubuntu 6.06.2 lts n l 方法二 sudo lsb release a 返回結果 方法三 cat etc lsb release 檢視linux版本 方法四 cat proc version 返回結果 linux version 2.6...

檢視ubuntu版本號

方法一 cat etc issue 返回結果 ubuntu 6.06.2 lts n l 方法二 sudo lsb release a 返回結果 方法三 cat etc lsb release 檢視linux版本 方法四 cat proc version 返回結果 linux version 2.6...