[轉] Linux 檢視系統核心版本和發行版本
阿新 • • 發佈:2018-11-09
一、檢視 Linux 核心版本命令
以下兩條命令適合所有 Linux
系統。
1、cat /proc/version
複製1 2 3 4 5 |
$ 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 ➜ ~ cat /proc/version |
2、uname -a
複製1 2 3 4 5 |
$ uname -a Linux centos 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux |
二、檢視 Linux 系統版本的命令
1、lsb_release -a
複製1 2 3 4 5 6 7 8 9 10 11 12 13 |
$ lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch |
這個命令適用於所有的 Linux
發行版,包括 Redhat
、SuSE
、Debian…
等發行版。
有的系統中預設並沒有安裝 lsb_release
,需要安裝。下面介紹一下 CentOS
系統中安裝方法。
首先查詢 lsb_release
安裝包:
1 2 3 4 5 6 7 8 9 10 |
$ yum provides lsb_release 已載入外掛:fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirrors.btte.net redhat-lsb-core-4.1-27.el7.centos.1.i686 : LSB Core module support 源 :base 匹配來源: 檔名 :/usr/bin/lsb_release |
安裝:
複製1
|
$ sudo yum install -y redhat-lsb-core
|
2、cat /etc/redhat-release
這種方法只適合檢視 Redhat
系的 Linux
,如:CentOS
。
1 2 |
$ cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) |
3、cat /etc/issue
此命令適用於所有的 Linux
發行版。
1 2 |
➜ ~ cat /etc/issue Ubuntu 16.04.1 LTS \n \l |