最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[记录]查看CentOS系统版本信息

CentOS crifan 2082浏览 0评论

Centos中想要查看Linux内核系统版本和centos版本。

之前就只知道有个lsb_release

去试试:

[root@AY140128113754462e2eZ ~]# lsb_release –help
FSG lsb_release v2.0 prints certain LSB (Linux Standard Base) and
Distribution information.
Usage: lsb_release [OPTION]…
With no OPTION specified defaults to -v.
Options:
  -v, –version
    Display the version of the LSB specification against which the distribution is compliant.
  -i, –id
    Display the string id of the distributor.
  -d, –description
    Display the single line text description of the distribution.
  -r, –release
    Display the release number of the distribution.
  -c, –codename
    Display the codename according to the distribution release.
  -a, –all
    Display all of the above information.
  -s, –short
    Use short output format for information requested by other options (or version if none).
  -h, –help
    Display this message.
[root@AY140128113754462e2eZ ~]# lsb_release -v
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
[root@AY140128113754462e2eZ ~]# lsb_release -i
Distributor ID: CentOS
[root@AY140128113754462e2eZ ~]# lsb_release -d
Description:    CentOS release 6.8 (Final)
[root@AY140128113754462e2eZ ~]# lsb_release -r
Release:        6.8
[root@AY140128113754462e2eZ ~]# lsb_release -c
Codename:       Final
[root@AY140128113754462e2eZ ~]# lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.8 (Final)
Release:        6.8
Codename:       Final

后来搜:

centos lsb_release

参考:

Command to check centOS version

知道了更多的办法:

[root@AY140128113754462e2eZ ~]# cat /etc/redhat-
redhat-lsb/     redhat-release  
[root@AY140128113754462e2eZ ~]# cat /etc/redhat-release 
CentOS release 6.8 (Final)
[root@AY140128113754462e2eZ ~]# cat /etc/centos-release 
CentOS release 6.8 (Final)
[root@AY140128113754462e2eZ ~]# cat /etc/*-release
CentOS release 6.8 (Final)
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
CentOS release 6.8 (Final)
CentOS release 6.8 (Final)
[root@AY140128113754462e2eZ ~]# cat /etc/issue          
CentOS release 6.8 (Final)
Kernel \r on an \m
[root@AY140128113754462e2eZ ~]# cat /etc/issue.net 
CentOS release 6.8 (Final)
Kernel \r on an \m
[root@AY140128113754462e2eZ ~]# cat /etc/issue*
CentOS release 6.8 (Final)
Kernel \r on an \m
CentOS release 6.8 (Final)
Kernel \r on an \m
[root@AY140128113754462e2eZ ~]# rp
rpcgen       rpm          rpmbuild     rpmquery     rpmverify    
rpc.rquotad  rpm2cpio     rpmdb        rpmsign      
[root@AY140128113754462e2eZ ~]# rpm -q centos-release
centos-release-6-8.el6.centos.12.3.x86_64
[root@AY140128113754462e2eZ ~]#

再去试试通用的:

[root@AY140128113754462e2eZ ~]# uname -a
Linux AY140128113754462e2eZ 3.10.101-1.el6.elrepo.x86_64 #1 SMP Wed Mar 16 20:55:27 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@AY140128113754462e2eZ ~]# arch
x86_64
[root@AY140128113754462e2eZ ~]# cat /proc/version 
Linux version 3.10.101-1.el6.elrepo.x86_64 (mockbuild@Build64R6) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Mar 16 20:55:27 EDT 2016
[root@AY140128113754462e2eZ ~]#

【总结】

<code> lsb_release -a
</code>

可以查看到CentOS的版本信息。

只是想要看CentOS的版本的话,可以用:

<code>cat /etc/centos-release
</code>

比如此处输出:

<code>CentOS release 6.8 (Final)
</code>

表示是6.8的CentOS

另外也可以用:

<code>uname -a
</code>

或:

cat /proc/version

查看常见的Linux系统的信息

转载请注明:在路上 » [记录]查看CentOS系统版本信息

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.160 seconds, using 22.08MB memory