Linux core version command

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! 🙂

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.

Источник

3 Ways to Check Linux Kernel Version in Command Line

You may find yourself in a situation where you need to know the exact Linux kernel version used on your system. Thanks to the powerful Linux command line, you can easily find that out.

A quick way to check Linux kernel version: You can use the following command to get the Linux kernel version:

There are other ways to get even more detailed information about kernels. Read the rest of the article to learn it in detail.

In this article, I’ll show you various methods for finding out your kernel version and tell you what those numbers mean. If you prefer videos, here’s a quick one:

Читайте также:  Создать файл сокета linux

Check Kernel Version In Linux

1. Find Linux kernel using uname command

uname is the Linux command for getting system information. You can also use it to find out whether you’re using a 32-bit or 64-bit system.

Open a terminal and type in the following command:

Checking Linux kernel version in command line

The output will be something similar to this:

This means that you’re running Linux kernel 4.4.0-97, or in more generic terms, you are running Linux kernel version 4.4.

But what do the other digits mean here? Let me explain:

  • 4 – Kernel version
  • 4 – Major revision
  • 0 – Minor revision
  • 97 – Bug fix
  • generic – Distribution-specific string. For Ubuntu, it means I’m using the desktop version. For Ubuntu server edition, it would be ‘server’.

You can also use the uname command with the option -a. This will provide more system information if you need it.

Checking Linux kernel version in command line

The output of the command should look like this:

Linux itsfoss 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Let me explain the output and what it means:

  • Linux – Kernel name. If you run the same command on BSD or macOS, the result will be different.
  • itsfoss – Hostname.
  • 4.4.0-97-generic – Kernel release (as we saw above).
  • #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 – This means that Ubuntu has compiled 4.4.0-97-generic 120 times. A timestamp for the last compilation is also there.
  • x86_64 – Machine architecture.
  • x86_64 – Processor architecture.
  • x86_64 – Operating system architecture (you can run a 32-bit OS on a 64-bit processor).
  • GNU/Linux – Operating system (and no, it won’t show the distribution name).

But I’ll save you from information overload. Let’s see some other commands to find your Linux kernel version.

2. Find Linux kernel using /proc/version file

In Linux, you can also find the kernel information in the file /proc/version. Just look at the contents of this file:

Checking Linux kernel version in command line

You’ll see an output similar to what you saw with uname.

Linux version 4.4.0-97-generic ([email protected]) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017

You can see the kernel version 4.4.0-97-generic here.

3. Find Linux kernel version using dmesg command

dmesg is a powerful command used for writing kernel messages. It’s also very useful for getting system information.

Since dmesg provides an awful lot of information, you should normally use a command like less to read it. But since we’re here just to check the Linux kernel version, grepping on ‘Linux’ should give the desired output.

Checking Linux kernel version in command line

The output will have a few lines but you should be able to identify the Linux kernel version there easily.

[ 0.000000] Linux version 4.4.0-97-generic ([email protected]) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 (Ubuntu 4.4.0-97.120-generic 4.4.87) [ 0.182880] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored [ 1.003861] Linux agpgart interface v0.103 [ 1.007875] usb usb1: Manufacturer: Linux 4.4.0-97-generic xhci-hcd [ 1.009983] usb usb2: Manufacturer: Linux 4.4.0-97-generic xhci-hcd [ 5.371748] media: Linux media interface: v0.10 [ 5.399948] Linux video capture interface: v2.00 [ 5.651287] VBoxPciLinuxInit

How do you check your Linux Kernel version and other information?

Of the three ways discussed here, I use uname all the time. It’s the most convenient.

Читайте также:  Linux что такое gateway

What about you? Which command do you prefer for getting Linux kernel information?

Источник

How to check Kernel version on Linux

Every Linux system is running a Linux kernel, which serves as the foundation for a fully packaged operating system. As technology evolves, the Linux kernel receives updates to accommodate new hardware, features, and security patches.

Keeping your Linux kernel up to date is an important task for administrators and users alike. Do you know what kernel version your Linux distribution is running? In this guide, we’ll show you how to find the Linux kernel version through various command line utilities.

In this tutorial you will learn:

Multiple commands showing the kernel version of a Linux system

Software Requirements and Linux Command Line Conventions

Category Requirements, Conventions or Software Version Used
System Any Linux distro
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to check kernel version via uname command

We can use the uname Linux command to see our system’s kernel version. Open a terminal and execute the following command to see yours.

$ uname -srm Linux 5.8.0-44-generic x86_64

The output shows us that we’re running kernel version 5.8.0-44 .

Here’s what each of these numbers mean:

  • 5 – Kernel version.
  • 8 – Major revision.
  • 0 – Minor revision.
  • 44 – Patch number.
  • The x86-64 indicates the CPU architecture that the kernel is compiled for.

To see more information about your particular kernel build, which gives us distribution-specific details, you can also add the -v option.

$ uname -srmv Linux 5.8.0-44-generic #50~20.04.1-Ubuntu SMP Wed Feb 10 21:07:30 UTC 2021 x86_64

How to check kernel version via hostnamectl command

Linux systems that use systemd, which is the vast majority of distros these days, can utilize the hostnamectl command to see kernel information.

$ hostnamectl Static hostname: linuxconfig Icon name: computer-vm Chassis: vm Machine ID: 4c1c3db5471746bd814d2bf4344b59eb Boot ID: 519f6ac7cc79448aadeefbfd995283eb Virtualization: oracle Operating System: Ubuntu 20.04.2 LTS Kernel: Linux 5.8.0-44-generic Architecture: x86-64

Or, for a more concise output:

$ hostnamectl | grep Kernel Kernel: Linux 5.8.0-44-generic

How to check kernel version via /proc/version file

You may also view the /proc/version file, which contains kernel information.

$ cat /proc/version Linux version 5.8.0-44-generic (buildd@lgw01-amd64-054) (gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #50~20.04.1-Ubuntu SMP Wed Feb 10 21:07:30 UTC 2021

Conclusion

In this guide, we saw several commands that can be used to reveal a Linux system’s kernel version. These commands will work on any major Linux distro, so you can use them regardless of what distro you’re running.

Читайте также:  Лучшие видеоплееры линукс минт

Comments and Discussions

NEWSLETTER

Subscribe to Linux Career Newsletter to receive latest news, jobs, career advice and featured configuration tutorials.

WRITE FOR US

LinuxConfig is looking for a technical writer(s) geared towards GNU/Linux and FLOSS technologies. Your articles will feature various GNU/Linux configuration tutorials and FLOSS technologies used in combination with GNU/Linux operating system.

When writing your articles you will be expected to be able to keep up with a technological advancement regarding the above mentioned technical area of expertise. You will work independently and be able to produce at minimum 2 technical articles a month.

TAGS

  • VIM tutorial for beginners
  • How to install the NVIDIA drivers on Ubuntu 20.04 Focal Fossa Linux
  • Bash Scripting Tutorial for Beginners
  • How to check CentOS version
  • How to find my IP address on Ubuntu 20.04 Focal Fossa Linux
  • Ubuntu 20.04 Remote Desktop Access from Windows 10
  • Howto mount USB drive in Linux
  • How to install missing ifconfig command on Debian Linux
  • AMD Radeon Ubuntu 20.04 Driver Installation
  • Ubuntu Static IP configuration
  • How to use bash array in a shell script
  • Linux IP forwarding – How to Disable/Enable
  • How to install Tweak Tool on Ubuntu 20.04 LTS Focal Fossa Linux
  • How to enable/disable firewall on Ubuntu 18.04 Bionic Beaver Linux
  • Netplan static IP on Ubuntu configuration
  • How to change from default to alternative Python version on Debian Linux
  • Set Kali root password and enable root login
  • How to Install Adobe Acrobat Reader on Ubuntu 20.04 Focal Fossa Linux
  • How to install the NVIDIA drivers on Ubuntu 18.04 Bionic Beaver Linux
  • How to check NVIDIA driver version on your Linux system
  • Nvidia RTX 3080 Ethereum Hashrate and Mining Overclock settings on HiveOS Linux

LATEST TUTORIALS

  • Easy Steps to Update Your Raspberry Pi
  • Connecting Your Raspberry Pi to Wi-Fi: A How-To
  • How to install RealVNC viewer on Linux
  • How to check Raspberry Pi RAM size and usage
  • How to check Raspberry Pi model
  • Understanding UEFI and BIOS in Relation to Linux Nvidia Driver Installation
  • How to orchestrate Borg backups with Borgmatic
  • How to monitor filesystem events on files and directories on Linux
  • Debian USB Firmware Loader Script
  • How to install and self host an Ntfy server on Linux
  • How to backup your git repositories with gickup
  • How to bind an SSH public key to a specific command
  • Creating a Bootable USB for Windows 10 and 11 on Linux
  • How to list all displays on Linux
  • List of QR code generators on Linux
  • How to extract text from image
  • Linux EOF explained
  • How to use xclip on Linux
  • List of window managers on Linux
  • What is zombie process on Linux

Источник

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