一,查看Linux内核版本命令(两种方法)
1、cat /proc/version
[user@fgejjw7Z home]$ cat /proc/version
Linux version 3.10.-.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8. (Red Hat 4.8.-) (GCC) ) # SMP
2、uname -a
[user@fgejjw7Z home]$ uname -a
Linux iZ28fgejjw7Z 3.10.-.el7.x86_64 # SMP Thu Nov :: UTC x86_64 x86_64 x86_64 GNU/Linux
[wcg@iZ28fgejjw7Z home]$
二、查看Linux系统版本的命令(3种方法):
1、lsb_release -a,即可列出所有版本信息:
[user@fgejjw7Z home]$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.2. (Core)
Release: 7.2.
Codename: Core
这个命令适用于所有的Linux发行版,包括Redhat、SuSE、Debian…等发行版。
2、cat /etc/redhat-release,这种方法只适合Redhat系的Linux:
[user@fgejjw7Z home]$ cat /etc/redhat-release
CentOS Linux release 7.2. (Core)
3、cat /etc/issue,此命令也适用于所有的Linux发行版:
[user@fgejjw7Z home]$ cat /etc/issue
\S
Kernel \r on an \m