1. 查看内核版本命令:
1) [root@localhost ~]# cat /proc/version
Linux version 2.6.18-238.12.1.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Tue May 31 13:23:01 EDT 2011
Linux version 2.6.18-238.12.1.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Tue May 31 13:23:01 EDT 2011
2) [root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:23:01 EDT 2011 i686 i686 i386 GNU/Linux
Linux localhost.localdomain 2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:23:01 EDT 2011 i686 i686 i386 GNU/Linux
3) [root@localhost ~]# uname -r
2.6.18-238.12.1.el5
2.6.18-238.12.1.el5
2. 查看linux版本:
1) 登录到服务器执行 lsb_release -a ,即可列出所有版本信息,例如:
[root@localhost ~]# [root@q1test01 ~]# lsb_release -a
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.6 (Final)
Release: 5.6
Codename: Final
注:这个命令适用于所有的linux,包括Redhat、SuSE、Debian等发行版。
2) 登录到linux执行cat /etc/issue,例如如下:
[root@localhost ~]# cat /etc/issue
CentOS release 5.6 (Final)
CentOS release 5.6 (Final)
Kernel \r on an \m
3) 登录到linux执行cat /etc/redhat-release ,例如如下:
[root@localhost ~]# cat /etc/redhat-release
CentOS release 5.6 (Final)
CentOS release 5.6 (Final)
4) 登录到linux执行rpm -q redhat-release ,例如如下:
[root@q1test01 ~]# rpm -q redhat-release
没有评论:
发表评论