首页 > 系统相关 >查看linux是centos还是ubuntu的方法

查看linux是centos还是ubuntu的方法

时间:2023-02-13 12:12:58浏览次数:34  
标签:lsb centos linux cat etc ubuntu release

以下总结了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

标签:lsb,centos,linux,cat,etc,ubuntu,release
From: https://www.cnblogs.com/egreen/p/17115850.html

相关文章

  • CentOS7下缺少头文件处理办法
    联网状态下可以使用provides查询依赖项,如缺少libusb.h,可使用:yumprovides*/libusb.h  执行yuminstall libusbx-devel安装完成即可。......
  • ubuntu 下安装 samba
    https://www.cnblogs.com/kengshen/p/16844240.html点击查看代码[share]comment=PrinterDriverspath=/home/hugh/sharebrowseable=yesguestok......
  • linux uniq命令详解
    Linuxuniq命令读取输入文件,并比较相邻的行。在正常情况下,第二个及以后更多个重复行将被删去,行比较是根据所用字符集的排序序列进行的。该命令加工后的结果写到输出文件中......
  • centos下安装部署nginx
    1.在安装Nginx之前,要确保已经安装了需要的软件:gcc、pcre-devel、zlib-devel、openssl-devel。如果没有安装,执行下面命令。  yum-yinstallgccpcre-develzlib-deve......
  • Linux上传文件没有权限,添加文件权限命令
    Linux上传文件没有权限,添加文件权限命令1、进入需要被上传的目录中cd需要被上传的目录路径2、获取root权限,这个命令切换用户为root,且不需要root的密码,输入当前用户的......
  • [转]linux下的CPU压力测试工具与方法介绍
    原文地址:linux下的CPU压力测试工具与方法介绍-简书(jianshu.com)使用工具stressCentos#yum-yinstallstressUbantu#apt-getinstallstress#stress--......
  • Linux编程获取本机IP地址 + socket相关系统调用的调用流程
    1 ifaddrs结构体定义如下C代码  1structifaddrs2{3structifaddrs*ifa_next;/*Nextiteminlist*/4char......
  • linux 下 dynv6 更新 ddns 域名对应ip
    基本原理:1.通过某些网站提供的api返回公网ip2.与本地文件记录的上次ip对照,如果相同,结束;如果不同使用 dynv6提供的api进行更新3.将上述逻辑写成脚本,利用......
  • https//mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64'
    CondaHTTPError:HTTP000CONNECTIONFAILEDforurl<https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64/current_repodata.json> Elap......
  • Linux命令篇 - tar 命令
    tarGNU`tar'savesmanyfilestogetherintoasingletapeordiskarchive,andcanrestoreindividualfilesfromthearchive.tar:用于压缩和解压缩文件;格式:tar......