查看系统信息,区分Centos和Ubuntu

# cat /etc/issue
\S
Kernel \r on an \m

centos

$ cat /etc/issue
Ubuntu 16.04.4 LTS \n \l

ubuntu

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

# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

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

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"

再一个简单的就是,看看安装指令,有yum的就是Centos,有apt-get的就是Ubuntu。

还有就是uname -v 或者 uname -a 这个有可能区分不了。

最新文章

  1. for循环和迭代
  2. array_merge注意细节
  3. Linux 远程登录
  4. ThinkBox DOC
  5. nested exception is org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 56; cvc-complex-type.2.4.c通配符的匹配很全面, 但无法找到元素 'dubbo:application' 的声明
  6. iTunes获取下载的安装包
  7. asp.net 实现对xml文件的 读取,添加,删除,修改
  8. Linux 配置Jenkins
  9. mvc路由报错
  10. IMPALA部署和架构(一)
  11. jdk动态代理和cglib动态代理
  12. PAT 甲级 1022 Digital Library
  13. J2EE开发之三种项目架构
  14. Reusable async validation for WPF with Prism 5
  15. [agc006E]Rotate 3x3
  16. memcached内存分配机制
  17. oracle安装注意
  18. vs2012 提示 未能正确加载 "Visual C++ Language Manager Package" 包
  19. use html5 video tag with MSE for h264 live streaming
  20. webpack初步搭建Vue项目

热门文章

  1. indy9在程序关闭时出现terminate thread timeout的BUG解决办法
  2. android_浅析canvas的save()和restore()方法
  3. socket阻塞与非阻塞,同步与异步I/O模型
  4. sql语句 MySQL
  5. C#中toolStrip或statusStrip遮挡了SplitContainer怎么办?
  6. hdu1034 简单模拟
  7. nginx使用指南
  8. 为什么在 Java 中用 (low+high)>>>1 代替 (low+high)/2 或 (low+high)>>1 来计算平均值呢?好在哪里?
  9. 02 http协议之方法与状态码
  10. cookie、session及实现记住密码,自动登录