方法1:用
lsb_release -a
命令[root@bogon ~]# lsb_release -a
lsb version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
distributor id: centos
description: centos linux release 7.4.1708 (core)
release: 7.4.1708
codename: core
這個命令可以看到準確的系統版本
如果出現下面提示,說明沒有安裝lsb_release命令
bash: lsb_release: 未找到命令
...安裝lsb_release命令:
yum install -y redhat-lsb
方法2:
cat /etc/os-release
命令[root@bogon ~]# cat /etc/os-release
name="centos linux"
version="7 (core)"
id="centos"
id_like="rhel fedora"
version_id="7"
pretty_name="centos linux 7 (core)"
ansi_color="0;31"
cpe_name="cpe:/o:centos:centos:7"
home_url=""
bug_report_url=""
centos_mantisbt_project="centos-7"
centos_mantisbt_project_version="7"
redhat_support_product="centos"
redhat_support_product_version="7"
這個命令看不到具體的版本資訊,但是可以看到除詳細版本資訊之外的其他資訊
方法3:
cat /etc/redhat-release
命令[root@bogon ~]# cat /etc/redhat-release
centos linux release 7.4.1708 (core)
這個命令效果同lsb_release -a
,不過這個命令只顯示系統版本
方法1:用
cat /proc/version
命令[root@bogon ~]# cat /proc/version
linux version 3.10.0-693.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (red hat 4.8.5-16) (gcc) ) #1 smp tue aug 22 21:09:27 utc 2017
方法2:用
uname -a
命令[root@bogon ~]# uname -a
linux bogon 3.10.0-693.el7.x86_64 #1 smp tue aug 22 21:09:27 utc 2017 x86_64 x86_64 x86_64 gnu/linux
這個就一種方式,最好判斷,用getconf long_bit。
32位的系統中
int型別和
long
型別一般都是
4位元組,
64位的系統中
int型別還是
4位元組的,但是
long
已變成了8位元組
inux
系統中可用
"getconf word_bit"
和"getconf long_bit"
獲得word
和long
的位數。
64位系統中應該分別得到32和
64。也就說32位使用這兩個命令得到的都是
32,64
位得到的32和
64。[root@bogon ~]# getconf word_bit
[root@bogon ~]# getconf long_bit
擴充套件請看
CentOS7 如何檢視系統版本資訊
centos的版本號資訊一般存放在配置檔案當中,在centos中,與其版本相關的配置檔案中都有centos關鍵字,該檔案一般存放在 etc 目錄下,所以說我們可以直接在該資料夾下搜尋相關的檔案。ll etc centos 檢視的結果 其中存放其版本配置資訊的檔案為 centos release ce...
Centos7檢視版本資訊
centos的版本號資訊存放在 etc 目錄下的配置檔案當中,與其版本相關的配置檔案中都有centos關鍵字,我們可以直接搜尋該資料夾下與centos相關的檔案。etc為系統配置檔案目錄,該目錄包含系統啟動指令碼 啟動配置檔案 使用者登陸配置檔案 網路配置檔案 httpd 配置檔案和其他檔案等。執行...
CentOS7 檢視作業系統版本資訊
centos 檢視作業系統版本資訊 1 使用cat proc version uname 檢視核心版本 root centos7 cat proc version linux version 3.10.0 957.el7.x86 64 mockbuild kbuilder.bsys.centos.o...