table of Contents
Currently only in CentOS
the Ubuntu
system testing, the other system will be slightly different.
1. Via command: less /proc/version
(Kernel and release information)
-
Centos 8
Linux version 4.18.0-147.5.1.el8_1.x86_64 ([email protected]) (gcc version 8.3.1 20190507 (Red Hat 8.3.1-4) (GCC)) #1 SMP Wed Feb 5 02:00:39 UTC 2020
-
Ubuntu 18.04.1
Linux version 4.15.0-65-generic (buildd@lgw01-amd64-006) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019
Note:
- Different systems may display different, but generally can be distinguished.
Linux version
Refers to the kernel version.CentOS
Words:el8_1
,数字 8
representatives areCentOS 8
Ubuntu
It is the latter,18.04.1
which means it isUbuntu 18.04
2. Through the command: uname -a
(Kernel and release information)
- CentOS 8
Linux iZ2ze90lblkm0mixai571vZ 4.18.0-147.5.1.el8_1.x86_64 #1 SMP Wed Feb 5 02:00:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Determined by el8 is CentOS8.
- Ubuntu
Linux blog 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Determine the Ubuntu system through Ubuntu.
3. Through the command: lsb_release -a
(only view the release information)
- CentOS
Distributor ID: CentOS
Description: CentOS Linux release 8.1.1911 (Core)
Release: 8.1.1911
Codename: Core
- Ubuntu
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
4. through less /etc/*-release
command (view release information)
By less /etc/*-release
can match multiple files in command mode input :n
browse the next file, :p
browse a file, you can see more detailed information in this way, you can also view a particular file separately:
CentOS
: General View redhat-release
, os-release
, lsb-release
, system-release
. Different versions of these files may not be available.
Ubuntu
: General View os-release
, lsb-release
. Different versions of these files may not be available.
Generally speaking, you can get the kernel information and release information you want through the above methods. If you have other information, you can leave a message to add it.
Personal blog address: Roc's Blog