查看Linux版本

$lsb_release -a #Ubuntu下执行
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:    16.04
Codename:   xenial
$cat /etc/redhat-release  #CentOS下执行
CentOS Linux release 7.3.1611 (Core) 
原文地址:https://www.cnblogs.com/lishidefengchen/p/11444964.html