查看linux是centos还是ubuntu?让我们一起来了解下。
查看linux的方法有几种,不管是centos还是ubuntu都可以查看,下面具体介绍一下:
1、cat:centos和ubuntu用cat命令可以查看Linux。
命令cat /etc/redhat-release,centos:/etc/redhat-release 在这个文件。
命令cat etc/lsb-release,ubuntu : /etc/lsb-release 在这个文件。
2、lsb_release -a:centos和ubuntu都可以直接使用lsb_release -a命令来进行查看。
3、apt-get或者yum:Centos使用yum命令:yum -help,Ubuntu使用apt-get命令:apt-get -help。
今天的分享就是这些,希望能帮助大家。
linux怎么查看是不是centos版本?
linux怎么查看是不是centos版本
1、一行很简单的命令,就可以让立刻知道,是centos还是ubuntu,还是debian。
[root@test ~]#cat /etc/issueCentOS release 6.5 (Final)Kernel \r on an \mBashCopy
2、登录到服务器执行 lsb_release -a 即可列出所有版本信息
LSB是Linux Standard Base的缩写,lsb_release命令用来显示LSB和特定版本的相关信息。
如下:
[root@test ~]# lsb_release -aLSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarchDistributor ID: CentOSDescription: CentOS release 6.5 (Final)Release: 6.5Codename: FinalBashCopy
注: 这个命令适用于所有的linux,包括Redhat、SuSE、Debian等发行版。
3、登录到linux执行 cat /etc/redhat-release
[root@test ~]# cat /etc/redhat-releaseCentOS release 6.5 (Final)BashCopy
注:这种方式下可以直接看到具体的版本号,比如 AS4 Update 1。 只对 Redhat Linux有效!