Check whether the current operating system is ubuntu or centos

Check whether the current operating system is ubuntu or centos

1. Execute: lsb_release -a


2. Command: cat /etc/redhat-release


3. Command:  cat /etc/issue


Summary: In fact, it is to see if there is a certain file:

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 ]


The following two systems have not been used in practice.

Debian exists cat /etc/debian_version this file
Slackware exists cat /etc/slackware_version this file


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325978703&siteId=291194637