冰雪寒梅 發表於 2024-6-29 00:00:00

CentOS怎么看是哪个版本(CentOS版本查看)

<p>
        CentOS是Linux发行版之一,已经发布多个版本,那么你知道你使用的CentOS是哪个版本的吗?下面小编就给大家介绍下查看CentOS版本信息的方法,一起来学习下吧。</p><p>
        有以下命令可以查看:</p><p><strong># lsb_release -a</strong></p><p>
        LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch</p><p>
        Distributor ID: CentOS</p><p>
        Description: CentOS release 5.4 (Final)</p><p>
        Release: 5.4</p><p>
        Codename: Final</p><p>
        这个命令适用于所有的linux,包括Redhat、SuSE、Debian、Centos等发行版。</p><p>
        root@MyMail ~ # uname</p><p>
        Linux</p><p>
        root@MyMail ~ # uname -r</p><p>
        2.6.18-164.el5</p><p>
        # uname -a</p><p>
        Linux localhost.localdomain 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 i686 i686 i386 GNU/Linux</p><p><strong>以下二种方法适用于RedHat,CentOS</strong></p><p>
        root@MyMail ~ # cat /etc/redhat-release</p><p>
        CentOS release 5.4 (Final)</p><p>
        登录到linux执行rpm -q redhat-release</p><p>
        #rpm -q redhat-release</p><p>
        或CentOS</p><p>
        root@MyMail ~ # rpm -q centos-release</p><p>
        centos-release-5-4.el5.centos.1</p><p><strong>当前centos 版本与redhat对应的版本的命令</strong></p><p>
        # cat /proc/version</p><p>
        Linux version 2.6.9-78.ELsmp (mockbuild@builder16.centos.org) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1 SMP Fri Jul 25 00:04:28 EDT 2008</p><p><strong>方法:</strong></p><p>
        1)# cat /proc/version</p><p>
        Linux version 2.6.18-194.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Fri Apr 2 14:58:14 EDT 2010</p><p>
        2)</p><p>
        # uname -a</p><p>
        Linux localhost.localdomain 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux</p><p>
        3)</p><p>
        # uname -r</p><p>
        2.6.18-194.el5</p><p>
        2. 查看linux版本:</p><p>
        1) 列出所有版本信息,</p><p><strong>[root@localhost ~]# lsb_release -a</strong></p><p>
        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</p><p>
        Distributor ID: CentOS</p><p>
        Description: CentOS release 5.5 (Final)</p><p>
        Release: 5.5</p><p>
        Codename: Final</p><p>
        注:这个命令适用于所有的linux,包括RedHat、SUSE、Debian等发行版。</p><p>
        2) 执行cat /etc/issue,例如如下:</p><p><strong>[root@localhost ~]# cat /etc/issue</strong></p><p>
        CentOS release 5.5 (Final)</p><p>
        Kernel r on an m</p><p>
        3) 执行cat /etc/redhat-release ,例如如下:</p><p><strong>[root@localhost ~]# cat /etc/redhat-release</strong></p><p>
        CentOS release 5.5 (Final)</p><p>
        查看系统是64位还是32位:</p><p><strong>1、getconf LONG_BIT or getconf WORD_BIT</strong></p><p>
        # getconf LONG_BIT</p><p><strong>64</strong></p><p><strong>2、file /bin/ls</strong></p><p><strong>[root@localhost ~]# file /bin/ls</strong></p><p>
        /bin/ls: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped</p><p><strong>3、lsb_release -a</strong></p><p>
        # lsb_release -a</p><p>
        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</p><p>
        Distributor ID: CentOS</p><p>
        Description: CentOS release 5.5 (Final)</p><p>
        Release: 5.5</p><p>
        Codename: Final</p><p><strong>4、或者是使用查看文件的方法。</strong></p><p>
        vim /ect/issue</p><p>
        上面就是查看CentOS版本信息的介绍了,除了能够知道你使用的是哪个版本外,还能够查看你所使用的CentOS系统是32位还是64位的。</p>
頁: [1]
查看完整版本: CentOS怎么看是哪个版本(CentOS版本查看)