GNU/Linux - 如何确定当前安装的Linux内核版本

本文介绍了在Linux系统上通过SSH、命令行工具(如`uname-r`、`hostnamectl`和`cat/proc/version`)确定内核版本的几种常见方法,特别提到了Ubuntu和CentOS等系统中内核版本的不同标识。
摘要由CSDN通过智能技术生成

确定安装的内核版本

有多种方法可以确定 Linux 系统上安装的内核版本。以下说明涵盖了最常见的方法:

1,通过 SSH 或直接登录计算实例。

2,运行以下命令之一显示内核版本:

  • uname -r: 只输出一行内核版本。

  • hostnamectl: 输出系统详细信息的有序列表,包括内核版本。只能在有 systemd 的发行版(Debian、Ubuntu、CentOS、openSUSE 等)上使用。

  • cat /proc/version: 输出包含内核版本和发行版详细信息的字符串。

内核版本应该是一个类似于 5.4.0-80-generic 的字符串。在本例中,内核以 generic 结尾,这在 Ubuntu 系统中很常见,表示这是一个上游内核。如果内核以类似于 linode123 结尾,则表示使用的是 Linode 内核,且字符串与精确的 Linode 内核版本一致。

Determine Which Kernel Is Installed

There are may ways you can determine which kernel version is installed on your Linux system. The following instructions cover the most common methods:

1. Log in to the Compute Instance through either SSH or directly.

2. Run one of the following commands to display the kernel version:

    * uname -r: Outputs a single line with just the kernel version.

    * hostnamectl: Outputs an organized list of system details, including the kernel version. Can only be used on distributions with systemd (Debian, Ubuntu, CentOS, openSUSE, and more).

    * cat /proc/version: Outputs a string that contains the kernel version and release details.

The kernel version should be a string that’s similar to 5.4.0-80-generic. In this example, the kernel ends with generic, which is common in Ubuntu systems to designate that this is an upstream kernel. If the kernel ends with something similar to linode123, a Linode kernel is being used and the string matches the precise Linode kernel release.

参考:

https://www.linode.com/docs/products/compute/compute-instances/guides/manage-the-kernel/

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜流冰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值