Linux View the current system kernel and release version information

Currently only in CentOSthe Ubuntusystem 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:

  1. Different systems may display different, but generally can be distinguished.
  2. Linux version Refers to the kernel version.
  3. CentOSWords:el8_1 , 数字 8representatives areCentOS 8
  4. UbuntuIt is the latter, 18.04.1which 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/*-releasecommand (view release information)

By less /etc/*-releasecan match multiple files in command mode input :nbrowse the next file, :pbrowse 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

Guess you like

Origin blog.csdn.net/peng2hui1314/article/details/108851837