查找Linux发行版名称,版本和内核详细信息, Find The Linux Distribution Name, Version And Kernel Details

 

查找Linux发行版名称,版本和内核详细信息, Find The Linux Distribution Name, Version And Kernel Details
查找Linux发行版名称,版本和内核详细信息, Find The Linux Distribution Name, Version And Kernel Details

 

1.查找Linux发行版名称,版本

有很多方法可以找出VPS中运行的操作系统。

方法1:

打开终端并运行以下命令:

$ cat /etc/*-release

 

CentOS 7的样本输出:

CentOS Linux release 7.0.1406 (Core) 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CentOS Linux release 7.0.1406 (Core) 
CentOS Linux release 7.0.1406 (Core)

 

Ubuntu 18.04的示例输出:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

 

方法2:

以下命令还将获取您的分发详细信息。

$ cat / etc / issue

 

Ubuntu 18.04的示例输出:

Ubuntu 18.04.2 LTS \n \l

 

方法3:

以下命令将为您提供Debian及其变体(如Ubuntu,Linux Mint等)中的分发详细信息。

$ lsb_release -a

 

样本输出:

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.2 LTS
Release:	18.04
Codename:	bionic

 

2.查找Linux内核详细信息

方法1:

要查找Linux内核详细信息,请从终端运行以下命令。

$ uname -a

 

CentOS 7中的示例输出:

Linux server.ostechnix.lan 3.10.0-123.9.3.el7.x86_64 #1 SMP Thu Nov 6 15:06:03 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

 

Ubuntu 18.04中的示例输出:

Linux ostechnix 4.18.0-25-generic #26~18.04.1-Ubuntu SMP Thu Jun 27 07:28:31 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

 

要么,

$ uname -mrs

 

样本输出:

Linux 4.18.0-25-generic x86_64

哪里,

  • Linux – 内核名称
  • 4.18.0-25-generic  – 内核版本
  • x86_64 – 系统硬件架构(即64位系统)

有关uname命令的更多详细信息,请参见手册页。

$ man uname

 

方法2:

在终端中,运行以下命令:

$ cat /proc/version

 

CentOS 7的样本输出:

Linux version 3.10.0-123.9.3.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Thu Nov 6 15:06:03 UTC 2014

 

Ubuntu 18.04的示例输出:

Linux version 4.18.0-25-generic (buildd@lgw01-amd64-033) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #26~18.04.1-Ubuntu SMP Thu Jun 27 07:28:31 UTC 2019

 

建议阅读:


这些是查找Linux发行版的名称,版本和内核详细信息的几种方法。希望你觉得它有用。

 

 

 

本文: 查找Linux发行版名称,版本和内核详细信息, Find The Linux Distribution Name, Version And Kernel Details

Loading

Add a Comment

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.