current position:Home>Check whether the Linux system is CentOS or Ubuntu or others

Check whether the Linux system is CentOS or Ubuntu or others

2022-01-27 02:12:23 Carrot rabbit

1、lsb_release -a

[[email protected] tools]# lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID:    CentOS
Description:    CentOS Linux release 7.2.1511 (Core) 
Release:    7.2.1511
Codename:    Core

Use this command if prompted :

[[email protected] ~]# lsb_release -a
-bash: lsb_release: Command not found

Install with command :yum install -y redhat-lsb

2、cat /etc/redhat-release

Apply to RedHat、CentOS

[[email protected] tools]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core) 

3、cat /etc/issue

uname Although the command cannot view the current system name and version , But it can display the core information of the system , You can also use cat /proc/version 

[[email protected] tools]# uname -a
Linux node1484 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[[email protected] tools]# cat /proc/version 
Linux version 3.10.0-327.el7.x86_64 ([email protected]) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Nov 19 22:10:57 UTC 2015
 

copyright notice
author[Carrot rabbit],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270212204321.html

Random recommended