uname
uname -a
会展示出Linux内核版本和发行时间
Linux localhost 3.10.0-1062.4.1.el7.x86_64 #1 SMP Fri Oct 18 17:15:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
/proc/version
cat /proc/version
相比于uname多了一个gcc的版本号。
Linux version 3.10.0-1062.4.1.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Fri Oct 18 17:15:30 UTC 2019
/etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
可以看到CentOS的发行版号