首页  >  文章  >  运维  >  查看linux是centos还是ubuntu的方法

查看linux是centos还是ubuntu的方法

angryTom
angryTom原创
2019-11-18 16:54:1630103浏览

查看linux是centos还是ubuntu的方法

查看linux是centos还是ubuntu的方法

以下总结了4种区分centos和ubuntu系统的方法。

1、lsb_release -a

如果是想查看你的Linux系统是Ubuntu还是CentOS,可以使用lsb_release -a命令,lsb_release -a命令可以列出你的Linux系统是哪个Linux发行版,它还可以列出具体是第几个版本。(推荐:linux使用教程

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

radhat或centos存在: /etc/redhat-release 这个文件【 命令 cat /etc/redhat-release 】

ubuntu存在 : /etc/lsb-release 这个文件 【命令 cat etc/lsb-release 】

3、apt-get && yum

有yum的就是Centos【yum -help】

有apt-get的就是Ubuntu 【apt-get -help】

4、cat /etc/issue

有Ubuntu字样为ubuntu,没有则是centos

以上是查看linux是centos还是ubuntu的方法的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn