Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

How to get the kernel version?

+7
−0

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.

History

0 comment threads

3 answers

+9
−0

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.

History

1 comment thread

Portability (1 comment)
+6
−0

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)
History

0 comment threads

+0
−0

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]

  1. fastfetch -l none | grep Kernel | yq '.Kernel'

  2. 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]

  1. #!/usr/bin/env python3
    import platform
    import builtins
    builtins.print(platform.uname())
    
  2. 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')


  1. discourse.gnome.org/t/29786/17 ↩︎

  2. stackoverflow.com/revisions/61780374/3 ↩︎

  3. python-forum.io/thread-33442-post-141201.html#pid141201 ↩︎

History

0 comment threads

Sign up to answer this question »