1.查看内核版本信息
# uname -a
ubuntu中输出:
Linux ubuntu 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
如下图:
centos中输出
Linux localhost.localdomain 3.10.0-514.26.1.el7.x86_64 #1 SMP Thu Jun 29 16:05:25 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
如下图:
2.查看ubuntu 系统版本
# cat /etc/os-release
输出:
NAME=”Ubuntu”
VERSION=”16.04.2 LTS (Xenial Xerus)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=”Ubuntu 16.04.2 LTS”
VERSION_ID=”16.04”
HOME_URL=”http://www.ubuntu.com/”
SUPPORT_URL=”http://help.ubuntu.com/”
BUG_REPORT_URL=”http://bugs.launchpad.net/ubuntu/”
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
3.查看centos 系统版本
# cat /etc/redhat-release
输出 CentOS Linux release 7.3.1611 (Core)