linux 查看系统是centos还是ubuntu或者其它

1、lsb_release -a

[root@node1484 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

使用该命令是如果提示:

[root@node1483 ~]# lsb_release -a
-bash: lsb_release: 未找到命令

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

2、cat /etc/redhat-release

适用于RedHat、CentOS

[root@node1484 tools]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core) 

3、cat /etc/issue

uname命令虽不能查看当前系统名和版本,但可以显示系统核心信息,也可以使用cat /proc/version 

[root@node1484 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
[root@node1484 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

猜你喜欢

转载自blog.csdn.net/showgea/article/details/82745107
今日推荐