How to get the kernel version?
How to get the version of the currently running Linux kernel?
I'm looking for a commandline solution, but feel free to post GUI solutions as well.
3 answers
uname, short for Unix Name, is part of GNU coreutils, and thus very likely already installed:
$ uname --kernel-release
6.13.3-arch1-1
It has some other potentially interesting flags too. Go and have a look at the docs.
You can find the version information in /proc/version.
$ cat /proc/version
Linux version 6.8.0-53-generic (buildd@lcy02-amd64-046) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #55-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 17 15:37:52 UTC 2025
In this case it is 6.8.0, with the distribution specific package version 6.8.0-53-generic.
Other methods to read the file (if cat is not available for some reason):
read version < /proc/version
echo $version
On some shells (e.g. bash, zsh) this will work:
echo $(</proc/version)
0 comment threads
If using KDE Plasma's desktop environment, even on an OS without GNU's coreutils (like Alpine Linux, but its BusyBox replacement does also include it), kinfo works. However, this does not operate outside Plasma. Replacing it, fastfetch [1] provides similar: [2]
-
fastfetch -l none | grep Kernel | yq '.Kernel' -
Linux
6.17.4-200.fc42.x86_64
However, if you (less conveniently) want the most information about your kernel, utilise ⪅ python3-3.13.9-1.fc42's platform.uname: [3]
-
#!/usr/bin/env python3 import platform import builtins builtins.print(platform.uname()) -
uname_result(system='Linux', node='Beedell.RokeJulianLockhart.desktop.SSV2AY', release='6.17.4-200.fc42.x86_64', version='#1 SMP PREEMPT_DYNAMIC Sun Oct 19 18:47:49 UTC 2025', machine='x86_64')

0 comment threads