一、查看Linux内核版本命令
1.cat /proc/version
[root@localhost ~]# cat /proc/version
Linux version 2.6.32-504.el6.i686 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313
(Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Oct 15 03:02:07 UTC 2014
2.uname -a
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-504.el6.i686 #1 SMP Wed Oct 15 03:02:07 UTC 2014 i686 i686 i386 GNU/Linux
3.uname -r
[root@localhost ~]# uname -r
2.6.32-504.el6.i686
二、查看Linux系统版本的命令
1】cat /etc/redhat-release,这种方法只适合Redhat系的Linux:
[root@localhost ~]# cat /etc/redhat-release
CentOS release 6.6 (Final)
2】cat /etc/issue,此命令也适用于所有的Linux发行版。
[root@localhost ~]# cat /etc/issue
CentOS release 6.6 (Final)
Kernel \r on an \m
3】
有安装红帽的用户执行结果:
①登录到linux执行rpm -q redhat-release ,例如如下:
[root@someone ~]# rpm -q redhat-release
redhat-release-5Server-5.6.0.3
② 登录到服务器执行 lsb_release -a ,即可列出所有版本信息,例如:
[root@someone ~]# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: RedHatEnterpriseAS
Description: Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
Release: 4
Codename: NahantUpdate4
这个命令适用于所有的Linux发行版,包括Redhat、SuSE、Debian…等发行版。
我的没有安装红帽的效果:
原文地址:http://yuan606.blog.51cto.com/11122628/1761334