# 查看Linux系统版本的命令(3种方法)
# cat /etc/issue
此命令也适用于所有的Linux发行版。
# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
# cat /etc/redhat-release
这种方法只适合Redhat系的Linux:
# cat /etc/redhat-release
CentOS release 6.5 (Final)
# lsb_release -a
即可列出所有版本信息:
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
# 查看Linux内核版本命令(两种方法):
# cat /proc/version
# cat /proc/version
Linux version 4.4.0-116-generic (buildd@lgw01-amd64-021) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) ) #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018
# uname -a
#uname -a
Linux junjun 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux