5 ways to check the system version in CentOs

藏色散人
Release: 2021-04-22 10:32:59
forward
45989 people have browsed it

The following tutorial column of centos will introduce you to 5 ways to check the system version in CentOs. I hope it will be helpful to friends in need!

Method 1

Command:
lsb_release -a

Example:

[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
Copy after login

Method 2

Command:
uname
uname -r
uname -a //The most comprehensive
(applicable to all linux, including Redhat, SuSE, Debian, Centos, etc.)

Example:

[root@www ~]# uname
Linux
[root@www ~]# uname -r
2.6.32-431.23.3.el6.x86_64
[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
Copy after login

Method 3

Command:
cat /etc/redhat-release
(Applicable to RedHat, CentOS)

Example:

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

Method 4

Command:
rpm -q redhat-release
rpm -q centos-release
(Applicable to RedHat, CentOS)

Example: (I did not install redhat, I installed CentOs)

[root@www ~]# cat /etc/redhat-release
package redhat-release is not installed
[root@www ~]# rpm -q centos-release
centos-release-6-7.el6.centos.12.3.x86_64
Copy after login

Method 5

Command:
cat /proc/version
(command between the current centos version and the version corresponding to redhat)

Example:

[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
Copy after login

The above is the detailed content of 5 ways to check the system version in CentOs. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template