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 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Nov 19 22:10:57 UTC 2015

  • 14
    点赞
  • 34
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值