Home >Operation and Maintenance >Linux Operation and Maintenance >How to check if linux is centos or ubuntu

How to check if linux is centos or ubuntu

angryTom
angryTomOriginal
2019-11-18 16:54:1630232browse

How to check if linux is centos or ubuntu

How to check whether linux is centos or ubuntu

The following summarizes 4 ways to distinguish centos and ubuntu systems .

1. lsb_release -a

If you want to check whether your Linux system is Ubuntu or CentOS, you can use the lsb_release -a command, lsb_release -a The command can list which Linux distribution your Linux system is, and it can also list the specific version. (Recommended: linux tutorial)

2, cat /etc/redhat-release && cat /etc/lsb-release

radhat or centos exists: /etc/redhat-release This file [command cat /etc/redhat-release ]

ubuntu exists: /etc /lsb-release this file [command cat etc/lsb-release ]

3. apt-get && yum

If there is yum, it is Centos [yum -help]

If there is apt-get, it is Ubuntu [apt-get -help]

4, cat /etc/issue

If there is Ubuntu, it is ubuntu , if not, centos

The above is the detailed content of How to check if linux is centos or ubuntu. 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