一、查看linux内核版本命令(两种方法):
1、cat /proc/version
[root@s-centos home]# cat /proc/version
linux version 2.6.32-431.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (red hat 4.4.7-4) (gcc) ) #1 smp fri nov 22 03:15:09 utc 2013
2、uname -a
[root@s-centos home]# uname -a
linux s-centos 2.6.32-431.el6.x86_64 #1 smp fri nov 22 03:15:09 utc 2013 x86_64 x86_64 x86_64 gnu/linux
二、查看linux系统版本的命令(3种方法):
1、lsb_release -a,即可列出所有版本信息:
[root@s-centos ~]# lsb_release -a
lsb version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
distributor id: centos
description: centos release 6.5 (final)
release: 6.5
codename: final
这个命令适用于所有的linux发行版,包括redhat、suse、debian…等发行版。
2、cat /etc/redhat-release,这种方法只适合redhat系的linux:
[root@s-centos home]# cat /etc/redhat-release
centos release 6.5 (final)
3、cat /etc/issue,此命令也适用于所有的linux发行版。
[root@s-centos home]# cat /etc/issue
centos release 6.5 (final)
kernel \r on an \m