3

If I'm looking at a version of the linux kernel source code, can I tell which version of the kernel it is?

This is code that's currently not running on any platform (so I can't execute commands), but is there any source file that lists the kernel version?

3

Check /usr/src/linux/.config , header files in /usr/src/linux/include/generated , /usr/src/linux/include/config/kernel.release

If you have a vmlinux file, try strings vmlinux | grep version

1
  • Or strings vmlinux | grep "Linux Version" – Th. Thielemann Sep 9 '20 at 12:20
4

In 4.0, you can run:

make kernelversion

Sample output:

4.0.0

Possible same question on SO: https://stackoverflow.com/questions/12151694/how-to-find-the-version-of-a-linux-kernel-source-tree

1
  • 2
    Alternatively head Makefile from top level of kernel source – austinmarton Jul 23 '15 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.