以下總結了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
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END
喜歡就支持一下吧
相關推薦