查看 CentOS 发行版本
$ cat /etc/redhat-release
输出为
CentOS Linux release 7 (Core)
查看 Ubuntu 发行版本
lsb 为 Linux Standard Base 的缩写
$ cat /etc/lsb-release
输出为
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
查看内核信息
$ uname -a
输出为
Linux ubuntu 4.15.0-122-generic #124~16.04.1-Ubuntu SMP Thu Oct 15 16:14:02 UTC 2020 i686 i686 i686 GNU/Linux