如何查看linux系统是CentOS还是Ubuntu
1.执行> lsb_release -a该命令存在表示为Ubuntu系统root@abc:~# lsb_release -aLSB Version:core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarchDistributor ID:UbuntuDescription:Ubuntu 18.04.5 LTSRelease:18.04Codename:bionic注意:有些版本的CentOS也是有该命令的[root@abc/]# lsb_release -aLSB Version::core-4.1-amd64:core-4.1-noarchDistributor ID:CentOSDescription:CentOS Linux release 7.9.2009 (Core)Release:7.9.2009Codename:Core2.执行> cat /etc/redhat-release文件存在则为CentOS[root@abc/]# cat /etc/redhat-releaseCentOS Linux release 7.9.2009 (Core)否则不是CentOSroot@abc:~# cat /etc/redhat-releasecat: /etc/redhat-release: No such file or directory
如有疑问、侵权等问题,请在评论区留言或私信。