- Linux Kernel Version Numbering
- How To Find Which Linux Kernel Version Is Installed On My System
- Commands to find your Linux Kernel Version
- How to check kernel version on Linux server/desktop/laptop
- Understanding uname command options
- Find Linux kernel using /proc/version file
- How to find your Linux Kernel version using hostnamect
- Related media
- Conclusion
- 3 Ways to Check Linux Kernel Version in Command Line
- How to find Linux kernel version
- 1. Find Linux kernel using uname command
- 2. Find Linux kernel using /proc/version file
- 3. Find Linux kernel version using dmesg commad
- How do you check your Linux kernel version and other information?
- Linux kernel version numbering
- 1 Answer 1
- Not the answer you’re looking for? Browse other questions tagged linux-kernel or ask your own question.
- Related
- Hot Network Questions
- Subscribe to RSS
- How to Check Kernel Version in Linux in Command Line
- 4 Commands to Find Linux Kernel Version
- uname Command
- hostnamectl Command
- Display the /proc/version File
- dmesg Command
Linux Kernel Version Numbering
Because there are numerous revisions and releases of the Linux kernel and new ones are developed at frequent intervals, it is important to have a system for clearly identifying them.
A kernel is a program that constitutes the central core of a computer operating system and which has complete control over everything that occurs in the system. The Linux kernel was originally developed by Linus Torvalds, who based it on (but did not copy) both UNIX and MINIX (an open source clone of UNIX).
The initial Linux kernels had a very simple numbering system. The first, which was released by Torvalds in September 1991, was designated 0.01. This was followed the next month by the 0.02 kernel. The current version numbering system began with the kernel 1.0, which was released in March 1994.
Linux kernels are now identified by a set of four numbers, sometimes supplemented by several additional characters. The first number denotes the kernel version. It is changed least frequently, and only when truly major changes in the concept and the code of the kernel occur. In fact, it has been changed only twice in the history of the kernel: in 1994 with version 1.0 and in 1996 with version 2.0.
The second number denotes the major revision of the kernel version. It was formerly the case that even numbers indicated a stable release, that is, one that was deemed fit for production use (i.e., use in a non-experimental environment), such as 1.2, 2.4 or 2.6. Likewise, odd numbers, such as 1.1 or 2.5, have historically represented development releases. They were for testing new features and device drivers until they became sufficiently stable to be included in a stable release. However, this has changed starting with the Linux 2.6.x series, and new feature development now takes place in the same revision number.
The third number indicates the minor revision of the kernel. It is only changed when new features or new drivers are added. The fourth number represents corrections, such as security patches and bug (i.e., error) fixes.
Sometimes the four numbers will be followed by several letters, such as rc1, ac, ck and mm. The letters rc (followed by a number) refer to a release candidate and thus indicate a non-official release. Other letters usually indicate the person responsible for that release, such as Alan Cox, Con Kolivas and Andrew Morton.
As of May 29, 2006 the newest release was 2.6.16.18, which was released on May 22. This superseded 2.6.16.17, which was released on May 20. The first version of the 2.6 kernel, 2.6.0, was released on December 18, 2003, and the current 2.6.16 minor revision was released on March 20, 2006.
There are several ways to determine which release of the kernel is being used on any particular system. Perhaps the easiest is to use the uname command (which reports basic information about a system’s hardware and software) with its -r option, that is,
Created May 29, 2006.
Copyright © 2006 The Linux Information Project. All Rights Reserved.
Источник
How To Find Which Linux Kernel Version Is Installed On My System
I am a new proud Linux user. My question to you is – how do I check Linux Kernel version? How do I find my Linux Kernel Version installed on my PC? Any help would be greatly appreciated.
Introduction : The Linux kernel is the central (core) component of Linux operating systems. Its responsibilities include managing the system’s resources and the communication between hardware and software components. It also maintains the security of your system. Hence, finding out the version information is a good idea for patching and other sysadmin management tasks.
Tutorial details | |
---|---|
Difficulty level | Easy |
Root privileges | No |
Requirements | None |
Est. reading time | 1m |
Commands to find your Linux Kernel Version
To check Linux Kernel version, try the following commands:
- uname -r : Find Linux kernel version
- cat /proc/version : Show Linux kernel version with help of a special file
- hostnamectl | grep Kernel : For systemd based Linux distro you can use hotnamectl to display hostname and running Linux kernel version
Let us see all commands and examples in details.
How to check kernel version on Linux server/desktop/laptop
You need to use then uname command to print certain system information including kernel name. Type the following command to print kernel version number:
$ uname -r
Sample outputs:
So my Linux kernel version is 4.15.0-39, where:
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
- 4 : Kernel version
- 15 : Major revision
- 0 : Minor revision
- 39 : Patch level or number
- generic : Linux distro/kernel specific additional info
Understanding uname command options
To print certain system information you use uname command. It has the following options:
-a, OR —all | print all information |
-s, OR —kernel-name | print the kernel name |
-n, OR —nodename | print the network node hostname |
-r, OR —kernel-release | print the Linux kernel release |
-v, OR —kernel-version | print the kernel version |
-m, OR —machine | print the machine hardware name |
-p, OR —processor | print the processor type or “unknown” |
-i, OR —hardware-platform | print the hardware platform or “unknown” |
-o, OR —operating-system | print the operating system |
Find Linux kernel using /proc/version file
Another option is to type the following cat command:
$ cat /proc/version
Sample outputs:
How to find your Linux Kernel version using hostnamect
Type the hostnamectl command along with grep command:
$ hostnamectl
$ hostnamectl | grep Kernel
Related media
This tutorial is also available in a quick video format:
Conclusion
You learned three diffent commands to display and show Linux kernel version on screen. For more info see the following pages too:
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Источник
3 Ways to Check Linux Kernel Version in Command Line
Last updated October 29, 2020 By Abhishek Prakash 25 Comments
Brief: Wondering which Linux kernel version your system uses? Here are several ways to check your kernel version in the Linux terminal.
You may find yourself in a situation where you need to know the exact Linux kernel version being used on your system. Thanks to the powerful Linux command line, you can easily find that out.
Quick way to check Linux kernel version
You can use the following command to get the Linux kernel version:
uname -r
There are other ways to get even more detailed information about kernel. 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 actually mean. If you prefer videos, here’s a quick one. Don’t forget to subscribe to our YouTube channel for more Linux tips.
How to find Linux kernel version
I am using Ubuntu while writing this article. But these commands are generic and can be used on Fedora, Debian, CentOS, SUSE Linux or any other Linux distribution.
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:
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.
The output of the command should like this:
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:
You’ll see an output similar to what you saw with uname.
You can see the kernel version 4.4.0-97-generic here.
3. Find Linux kernel version using dmesg commad
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.
The output will have a few lines but you should be able to identify the Linux kernel version there easily.
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.
What about you? Which command do you prefer for getting Linux kernel information?
Like what you read? Please share it with others.
Источник
Linux kernel version numbering
A while ago, I downloaded Linux kernel source 2.6.38.8 from kernel.org (http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.38.8.tar.gz). Today, I cloned github.com/torvalds/linux and tried to find the commit that produced that exact version. The closed thing I could find was a tag for v2.6.38-rc8.
When I did a diff -r on the two directories, there were 775 files that diffed (not including any files under .git/ ). Can anyone explain (or link an article) how the releases on http://www.kernel.org/pub/linux/kernel/v2.6 are created vs. the git tags?
1 Answer 1
Linus does not produce/tag sub-releases, only the major releases.
You want the linux-stable tree to find the .8 release. git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Note that Linus did tag v2.6.38 so you either didn’t pull recently enough or didn’t sort the tags correctly or something.
Not the answer you’re looking for? Browse other questions tagged linux-kernel or ask your own question.
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.10.8.40416
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Источник
How to Check Kernel Version in Linux in Command Line
Home » SysAdmin » How to Check Kernel Version in Linux in Command Line
Want to find out which kernel version you are running?
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.
- A system running Linux (Ubuntu, Debian, RHEL, CentOS, or another version)
- A terminal window / command line (Ctrl–Alt–T, Ctrl–Alt–F2)
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:
- 3 – This is the main kernelversion
- .10 – This is the major releaseversion
- .0 – This is the minor revisionlevel
- -957 – This is the level of patches and bug fixes
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
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:
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.
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.
Enter the command:
The | (pipe) symbol is usually on the same key as the symbol, just above the enter key.
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.
Источник