Kernel version command in linux

3 ways to check kernel version in Linux

If you’re a Linux user, it’s important to know your kernel version. The kernel is the core of the operating system, and it’s responsible for managing hardware and software resources. In this blog post, we will discuss three different ways to check your kernel version in Linux. Let’s get started!

The following commands can be used to check the kernel version in Linux.

Procedures to check kernel version in Linux

  • Open the terminal.
  • Type uname -r and press Enter. You will see the kernel version from the command output
  • If you want to see more information about your kernel, type uname -a and press Enter. This will show you the kernel version, as well as the date it was released and the name of the person who compiled it.

Understanding kernel version in Linux

The kernel version is important for a variety of reasons. It tells you which features are supported by your operating system, and it also provides information about the hardware compatibility.

If you need to troubleshoot a problem, the kernel version can be helpful in identifying the source of the issue. The Linux kernel is a critical part of your system, and it’s important to keep it up-to-date.

For example:Linux 4.15.0-54-generic x86_64

Linux kernel is 64-bit and its version is 4.15.0-54, where:

  • 4 – Kernel Version.
  • 15 – Major Revision.
  • 0 – Minor Revision.
  • 54 – Patch number.
  • generic – Distribution specific information.

check kernel version with uname command in Linux

The best Linux command to check the kernel version is to use the uname command. This command will print out information about your system, including the kernel version. Open a terminal and type “uname -r”. This will print out the kernel version number.

example: uname -r
4.18.0-305.el8.x86_64

The uname command is a Unix/Linux command that stands for “Unix Name”. It is used to display information about the system’s operating system and hardware. The uname command can display different types of information depending on the options used with it.

Here are some of the commonly used options with the uname command:

  • -a : Displays all the system information.
  • -s : Displays the operating system name.
  • -n : Displays the network (hostname) name of the machine.
  • -r : Displays the kernel release number.
  • -m : Displays the machine hardware name.
  • -p : Displays the processor type.
  • -i : Displays the hardware platform.
Читайте также:  Linux zen kernel manjaro

For example, if you use the uname -a command, it will display all the information about the system, including the operating system name, kernel version, machine hardware name, and processor type etc.

check kernel version with /proc/version file in Linux

Another way to check your kernel version is to look in the /proc/version file. This file contains information about your kernel and other system information. To view this file, simply type “cat /proc/version” in a terminal.

example: $ cat /proc/version
Linux version 4.18.0-305.el8.x86_64 (mockbuild@x86-vm-07.build.eng.bos.redhat.com) (gcc version 8.4.1 20200928 (Red Hat 8.4.1-1) (GCC)) #1 SMP Thu Apr 29 08:54:30 EDT 2021

The /proc directory in Linux is a virtual file system that provides an interface to kernel data structures and system information. It contains files and directories that expose information about various system resources, including processes, memory usage, CPU usage, network connections, and hardware devices.

Some of the commonly used files in /proc directory are:

  • /proc/cpuinfo: Provides information about the CPU installed on the system, such as its model, clock speed, and cache size.
  • /proc/meminfo: Provides information about the system’s memory usage, including the total amount of memory available, how much is in use, and how much is free.
  • /proc/filesystems: Lists all the file systems currently supported by the kernel.
  • /proc/loadavg: Provides the system load average, which is a measure of the amount of work the system is currently doing.

check kernel version with hostnamectl command in Linux

The third way to check your kernel version is to use the hostnamectl command. This command will print out information about your distribution, including the kernel version. To use the hostnamectl command, simply type “hostnamectl” in a terminal.

example: hostnamectl | grep -i kernel
Kernel: Linux 4.18.0-305.el8.x86_64

Static hostname: mycomputer
Icon name: computer-desktop
Chassis: desktop
Machine ID: 0123456789abcdef0123456789abcdef
Boot ID: 0123456789abcdef0123456789abcdef
Operating System: Ubuntu 20.04.3 LTS
Kernel: Linux 5.4.0-90-generic
Architecture: x86-64

In this example, the kernel version is “Linux 5.4.0-90-generic”.

Note that the output of hostnamectl status will also provide other useful information about the system, such as the machine ID, boot ID, and architecture.

We hope this blog post has been helpful. If you have any questions or comments, please feel free to leave them below. Thank you for reading!

David is a Cloud & DevOps Enthusiast. He has years of experience as a Linux engineer. He had working experience in AMD, EMC. He likes Linux, Python, bash, and more. He is a technical blogger and a Software Engineer. He enjoys sharing his learning and contributing to open-source.

howtouselinux.com is dedicated to providing comprehensive information on using Linux.

We hope you find our site helpful and informative.

Источник

How to Check Kernel Version in Linux in Command Line

The Linux kernel is much like the central brain of the operating system. Although it is open-source – meaning anyone can view and modify the code – the Linux kernel is built with multiple protocols to ensure stability and security.

This guide will walk you through how to check the Linux kernel version of your distribution.

Читайте также:  Astra linux install qt5

how to check linux kernel version command line

  • A system running Linux (Ubuntu, Debian, RHEL, CentOS, or another version)
  • A terminal window / command line (CtrlAltT, CtrlAltF2)

4 Commands to Find Linux Kernel Version

uname Command

Launch a terminal window, then enter the following:

The system will return a numeric code, for example:

Each number, separated by a dot or hyphen, is part of a code:

uname command to check kernel version

The uname command includes additional options that you can use to get more information about your kernel. Simply add an option after the command:

  • -a – Display all information
  • -o – Display the operating system (usually GNU/Linux)
  • -r – Display kernel release
  • -v – Display kernel version (usually includes the base OS and time the kernel was compiled)

For a full list of uname commands, enter

uname command for more kernel information

Note: Your kernel version will likely be different than this example. At the time of writing this article, the latest version is Linux kernel 5.0.

hostnamectl Command

The hostnamectl command is typically used to display information about the system’s network configuration. It also displays the kernel version.

To check the kernel version, enter the following:

The second-to-last line should read:

Kernel: Linux 3.10.0-957.21.2.el7.x86_64

hostnamectl

Display the /proc/version File

To display the proc/version file, enter the command:

The cat command displays the contents of the /proc/version file. This will output the Linux kernel version first, along with additional data about your operating system.

display proc_version file

dmesg Command

The dmesg command is used to print the message buffer of the kernel. This is usually used to read messages from device drivers, but it can also be used to find the kernel version.

The | (pipe) symbol is usually on the same key as the symbol, just above the enter key.

dmesg command

The commands work as follows:

  • dmesg – read the contents of the kernel buffer
  • | – pipe the command into the next command
  • grep – search for a particular string of characters, and display lines that contain them
  • Linux – the exact string of characters that grep should search for (capitalization matters)

The first line of output displays the Linux kernel version.

Note: When updating your kernel, it is recommended that you choose a release version that’s compatible with your version of Linux. Your package manager will typically give you kernel versions that are tested and verified.

This guide showed you several different ways to check the Linux kernel version. Since you’re only reading the output of a file, you shouldn’t need sudo privileges.

The Linux kernel has a modular design. Functionality is extendible with modules or drivers. Learn how to use the modprobe command to add or remove modules on Linux.

Источник

How do I find out the kernel version I am running?

I need this info so I can finish updating my STA Broadcom wireless. However, I’m a noob at Ubuntu and I’m not sure how to find the kernel version or kernel. I checked /lib/modules/ and found this:

2.6.27-10-generic 2.6.32-30-generic 2.6.32-34-generic 2.6.32-38-generic 2.6.27-7-generic 2.6.32-31-generic 2.6.32-35-generic 3.2.0-54-generic 2.6.28-19-generic 2.6.32-32-generic 2.6.32-36-generic 3.2.0-54-generic-pae 2.6.31-23-generic 2.6.32-33-generic 2.6.32-37-generic 

Which one is the running kernel? Another question. Is there a snippet so I don’t have to cut and paste? Thanks for your time! 🙂

Читайте также:  Обход блокировок интернета linux

6 Answers 6

Well there are multiple ways to find the kernel version

Open terminal and execute:

It would display something like:

You can get further information on the current kernel with

It would display something like:

Linux saurav-P4I45Gx-PE 3.8.0-30-generic #44~precise1-Ubuntu SMP Fri Aug 23 17:33:45 UTC 2013 i686 i686 i386 GNU/Linux 

Another way to know the kernel version is to open Synaptic Package Manager and search for linux image . You have to check for the installed Kernel version.

Another way to find version of installed kernels is to run this command:

dpkg -l | grep linux-image | grep ii 

or for just the version strings:

dpkg -l | grep linux-image | grep ii | awk '' 

The latest kernel (the one with the highest version number) will boot by default, so if you have rebooted since the last kernel update, and you have not made adjustments to boot into a kernel other than the default, then you can be reasonably confident that the highest version number displayed will be the version of the running kernel, but you should use uname for more reliable information.

Источник

Kernel version command in linux

How to check Debian version: the quick and easy way

How to check Debian version: the quick and easy way

Knowing which Debian version you have not only helps you to choose the right install package for a program – you also need it to get appropriate support in forums. There are several different methods to check your Debian version. In this step-by-step guide, we’ll explain how to check your version using Terminal and Hardinfo.

How to check your Ubuntu version: a guide

How to check your Ubuntu version: a guide

Knowing which Ubuntu version you’re running is helpful for different things. You can use this information to check whether programs are compatible with your system. Or you can include the version number in troubleshooting searches. It’s thus of crucial importance to know how to check your Ubuntu version. Keep reading to find out how to do so in a few simple clicks.

How to delete a Linux directory

How to delete a Linux directory

Sometimes you may need to delete an entire folder rather than just individual files. If you want to remove a Linux directory, there are several ways to do it. Here are a few basic solutions that use either File Manager or Terminal. We also explain what you can do if you don’t have the necessary rights.

How to delete files in Linux

How to delete files in Linux

Deleting files in Linux couldn’t be easier. Whether you use the file manager or work directly in the terminal with the command “rm”, you can remove Linux files in just a few clicks. Keep reading to find out how to remove single files, multiple files, files of a certain type, or entire folders.

How to use the Linux find command

How to use the Linux find command

While working on a Linux system the command line is frequently used. Many administrative tasks require you to find files and directories based on specific criteria. In doing so, Linux admins are accustomed to using the find command. Here, we’ll show you how the command works and how to use it as a handy tool.

Источник

Оцените статью
Adblock
detector