1. 程式人生 > >linux 檢視系統是centos還是ubuntu或者其它

linux 檢視系統是centos還是ubuntu或者其它

1、lsb_release -a

[[email protected] tools]# 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.2.1511 (Core) 
Release:    7.2.1511
Codename:    Core

使用該命令是如果提示:

[[email protected] ~]# lsb_release -a
-bash: lsb_release: 未找到命令

使用命令安裝:yum install -y redhat-lsb

2、cat /etc/redhat-release

適用於RedHat、CentOS

[[email protected] tools]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core) 

3、cat /etc/issue

uname命令雖不能檢視當前系統名和版本,但可以顯示系統核心資訊,也可以使用cat /proc/version 

[[email protected] tools]# uname -a
Linux node1484 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
[[email protected] tools]# 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