1. 查看核心版本
$ uname -or $ uname -a
2. rpm
$ rpm --query centos-release [On CentOS]
$ rpm --query redhat-release [On RHEL]
3. hostnamectl 推荐
$ hostnamectl
4. file
$ cat /etc/centos-release [On CentOS] $ cat /etc/redhat-release [On RHEL] $ cat /etc/system-release $ cat /etc/os-release #contains more information