Linux

1. 查看Linux内核版本命令

1.1 cat /proc/version

1
2
[root@iZ1wwcia0lb3yoZ ~]# cat /proc/version
Linux version 2.6.32-573.22.1.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Mar 23 03:35:39 UTC 2016

1.2 uname -a

1
2
[root@iZ1wwcia0lb3yoZ ~]# uname -a
Linux iZ1wwcia0lb3yoZ 2.6.32-573.22.1.el6.x86_64 #1 SMP Wed Mar 23 03:35:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

2. 查看Linux系统版本命令

2.1 lsb_release -a

这个命令可列出所有版本信息,适用于所有的Linux发行版,包括 Redhat、SuSE、Debian 等发行版

1
2
3
4
5
6
[root@iZ1wwcia0lb3yoZ ~]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.5 (Final)
Release: 6.5
Codename: Final

2.2 cat /etc/redhat-release

Redhat系的Linux系统适用

1
2
[root@iZ1wwcia0lb3yoZ ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)

2.3 cat /etc/issue

此命令也适用于所有的Linux发行版

1
2
3
[root@iZ1wwcia0lb3yoZ ~]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m