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!