How To Check Linux Kernel Version

I am a new Linux system user and MS-Windows XP refugees. How do I check Linux kernel version using a shell prompt?

You can use the following files to find out the kernel version that is currently running:
  1. /proc/version – This file stores a string which identifies the kernel version. It includes the contents of /proc/sys/kernel/ostype, /proc/sys/kernel/osrelease and /proc/sys/kernel/version.
Tutorial details
Difficulty Easy (rss)
Root privileges No
Requirements None
Time 1m
You can also use the following command for the same purpose:
  1. uname command – Display name and information about current kernel.
  2. Package manager such as rpm/yum or apt-get provides output information about the kernel.

How to find the kernel version using uname command

Open the Terminal application and type the following command to show you Linux system kernel version:
uname -r
Sample outputs:

2.6.32-431.1.2.el6.x86_64

Where,

  • 2.6.32 – Linux kernel version.
  • 431.1.2 – Distro specific number for bug and security fixes.

Here is another output from my Ubuntu based server:
uname -r
Sample outputs:

3.2.0-51-generic

The following command gives a little more information about Linux kernel and machine type:
uname -mrs
Sample outputs:

Linux 3.2.0-51-generic x86_64

Printing all information

The syntax is as follows to display all information about the current running Linux kernel:
uname -a
uname --all

Here is what I got from my Ubuntu 20.04 LTS desktop:

Linux nixcraft-wks01 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Where,

  1. Linux – Kernel name (duh!).
  2. nixcraft-wks01 – My computer name.
  3. 5.4.0-65-generic – Linux kernel release name.
  4. #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 – Kerenl version build date. SMP indicates that mulitple CPU/CORE support.
  5. x86_64 – My hardware/archicture type.
A list uname command line options
Option Description
-a, ---all View all information, in the following order, except omit -p and -i if unknown.
--s, ---kernel-name See the kernel name
--n, ---nodename Print the network node hostname
--r, ---kernel-release Display the kernel release
--v, ---kernel-version See the kernel version
--m, ---machine Show the machine hardware name
--p, ---processor Pint the processor type (non-portable)
--i, ---hardware-platform Print the hardware platform (non-portable)
--o, ---operating-system Print the operating system
---help Display this help and exit
---version Output version information and exit

How to check kernel version using /proc/version file

Use the cat command to look at /proc/version file:

## display my linux kernel version ##
cat /proc/version

Related media

This tutorial is also available in a quick video format:



Video 01: Find The Linux Kernel Version Command Tutorial

Conclusion

This page explained several ways to check kernel version in Linux terminal application. It is important that you keep your Linux kernel updated to avoid security problems.


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one

CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • IT Manager Mar 26, 2014 @ 7:16

    Hi,

    I always used uname -a on Unix and worked like a charm on Linux too.

    Cheers

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @ webmaster@cyberciti.biz