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.
2 answers
You are accessing this answer with a direct link, so it's being shown above all other answers regardless of its score. You can return to the normal view.
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
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.
0 comment threads