Linux查看系统版本
由于Linux操作系统有很多不同的衍生版本,RHEL、CentOS、Suse Linux等等,在对这些系统进行软件升级时,我们需要先了解具体的版本,以便做对应的软件包下载。
我们可以用lsb_release -a命令查询各系统的版本
[root@localhost /]# lsb_release -a LSB Version: :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: RedHatEnterpriseServer Description: Red Hat Enterprise Linux Server release 5.5 (Tikanga) Release: 5.5 Codename: Tikanga [root@localhost /]#
针对RHEL 还有以下四种方式查询
[root@localhost /]# cat /proc/version Linux version 2.6.18-194.el5 (mockbuild@x86-005.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:39 EDT 2010 [root@localhost /]#
[root@localhost /]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.5 (Tikanga) [root@localhost /]#
[root@localhost /]# rpm -q redhat-release redhat-release-5Server-5.5.0.2 [root@localhost /]#
[root@localhost /]# cat /etc/issue Red Hat Enterprise Linux Server release 5.5 (Tikanga) Kernel r on an m [root@localhost /]#
以上几种方法都可以查询到操作系统的版本,可根据需求对其进行查询。
–ENDOF–