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 fileSlackware exists cat /etc/slackware_version this file