Home  >  Article  >  Operation and Maintenance  >  How to check if linux is centos version

How to check if linux is centos version

WBOY
WBOYOriginal
2022-04-14 17:40:1618598browse

Method: 1. Use the "cat /etc/issue" command to display release version information; 2. Use the "lsb_release -a" command to display LSB and specific version information; 3. Use "cat /etc/redhat- release" command displays Redhat Linux version information.

How to check if linux is centos version

The operating environment of this article: centos 6.5 system, Dell G3 computer.

How to check if linux is centos version

1. With one simple command, you can immediately know whether it is centos, ubuntu, or debian.

[root@test ~]#cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
BashCopy

2. Log in to the server and execute lsb_release -a to list all version information

LSB is the abbreviation of Linux Standard Base. The lsb_release command is used to display LSB and specific version-related information.

is as follows:

[root@test ~]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.5 (Final)
Release: 6.5
Codename: Final
BashCopy

Note: This command applies to all Linux, including Redhat, SuSE, Debian and other distributions.

3. Log in to linux and execute cat /etc/redhat-release

[root@test ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)
BashCopy

Note: In this way, you can directly see the specific version number, such as AS4 Update 1. Only valid for Redhat Linux!

Recommended tutorial: "centos tutorial"

The above is the detailed content of How to check if linux is centos version. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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