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

Post History

66%
+2 −0
Q&A How to get the kernel version?

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, ...

posted 1mo ago by GeraldS‭  ·  edited 1mo ago by GeraldS‭

Answer
#2: Post edited by user avatar GeraldS‭ · 2025-02-26T06:23:25Z (about 1 month ago)
added more ways to read the file
  • You can find the version information in `/proc/version`.
  • ```console
  • $ 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`.
  • You can find the version information in `/proc/version`.
  • ```console
  • $ 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):
  • ```shell
  • read version < /proc/version
  • echo $version
  • ```
  • On some shells (e.g. bash, zsh) this will work:
  • ```shell
  • echo $(</proc/version)
  • ```
#1: Initial revision by user avatar GeraldS‭ · 2025-02-25T08:50:44Z (about 1 month ago)
You can find the version information in `/proc/version`.

```console
$ 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`.