有以下命令可以查看:
rpm -q centos-release
# lsb_release -a
lsb version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
distributor id: centos
description: centos release 5.4 (final)
release: 5.4
codename: final
这个命令适用于所有的linux,包括redhat、suse、debian、centos等发行版。
root@mymail ~ # uname
linux
root@mymail ~ # uname -r
2.6.18-164.el5
[root@localhost ~]# uname -a
linux localhost.localdomain 2.6.18-194.el5 #1 smp fri apr 2 14:58:35 edt 2010 i686 i686 i386 gnu/linux
以下二种方法适用于redhat,centos
root@mymail ~ # cat /etc/redhat-release
centos release 5.4 (final)
登录到linux执行rpm -q redhat-release
#rpm -q redhat-release
或centos
root@mymail ~ # rpm -q centos-release
centos-release-5-4.el5.centos.1
当前centos 版本与redhat对应的版本的命令
# cat /proc/version
linux version 2.6.9-78.elsmp ([email protected]) (gcc version 3.4.6 20060404 (red hat 3.4.6-10)) #1 smp fri jul 25 00:04:28 edt 2008