云服务器
centos查看系统版本的方法
2025-07-26 10:45  点击:0
CentOS 系统版本查询方法

方法1使用 lsb_release 命令

bash
[root@www ~] 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.7 (Final)
Release: 6.7
Codename: Final


方法2使用 uname 命令

bash
[root@www ~]# uname -a
Linux www 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


方法3查看 /etc/redhat-release 文件(适用于 RedHat 和 CentOS)

bash
[root@www ~]# cat /etc/redhat-release
CentOS release 6.7 (Final)


方法4使用 rpm 命令查询 redhat-releasecentos-release 包的信息

bash
[root@www ~]# rpm -q centos-release
centos-release-6-7.el6.centos.12.3.x86_64


方法5查看 /proc/version 文件(适用于所有 Linux 系统)

bash
[root@www ~]# cat /proc/version
Linux version 2.6.32-431.23.3.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Thu Jul 31 17:20:51 UTC 2014


以上是查询 CentOS 系统版本的几种常见方法。