Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does linux check what the current kernel version is

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail "how to check the current kernel version of linux" with detailed content, clear steps and proper handling of details. I hope that this article "how to check the current kernel version of linux" can help you solve your doubts.

View method: 1, with uname, you can display Linux kernel name version and other information, syntax "uname-srm"; 2, with hostnamectl, syntax "hostnamectl | grep-I kernel"; 3, execute "cat / proc/version" command.

The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

The Linux kernel is the core component of the GNU/Linux operating system. It is a free, open source, large, modular, multitasking Unix-like operating system kernel.

You may need to know exactly which kernel version is running on the GNU / Linux operating system for a number of reasons. Maybe you're debugging hardware-related problems, or learning about new security vulnerabilities that affect the old kernel version, and you want to know if your kernel is vulnerable.

Whatever the reason, it's easy to determine the Linux kernel version from the command line.

Linux method to see what the current kernel version is

1. Use the `uname` command to view the Linux kernel version

The uname command displays multiple system information, including the Linux kernel architecture, name version, and release.

To find out which version of the Linux kernel is running on the system, enter the following command:

Uname-srm

Output result:

Linux 3.10.0-957.12.2.el7.x86_64 x86 revision 643-kernel version. 10-major revision. 0-957-minor revision. 12-patch version.

2. Use the `hostnamectl` command to view the kernel version

The hostnamectl utility is part of systemd and is used to query and change the system hostname. It also displays Linux distributions and kernel versions:

HostnamectlStatic hostname: CentOS7.linuxrumen.comIcon name: computer-vmChassis: vmMachine ID: 20c27040135a4d46b2d3d07180f37303Boot ID: 2f495af0684e4adfb34f0366f2567460Virtualization: vmwareOperating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7Kernel: Linux 3.10.0-957.12.2.el7.x86_64Architecture: x86-64

Use the following command to display only the current kernel version:

Hostnamectl | grep-I kernel

3. Confirm the kernel version by viewing the / proc/version file

The / proc directory contains virtual files that contain information about system memory, CPU kernel, mounted file systems, and so on. Information about the running kernel is stored in the / proc/version virtual file.

View the contents of the file with cat:

Cat / proc/version

The output is as follows:

Linux version 3.10.0-957.12.2.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)) 1 SMP Tue May 14 21:24:32 UTC 2019, this article "how to check the current kernel version of linux" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it yourself. If you want to know more about related articles, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report