kernelversion – Prints the Major Version Number of the Current Kernel

The kernelversion command is a Linux utility that prints the major version number of the current kernel. This command is useful for quickly identifying the version of the kernel that is currently running on the system.

Overview

To use the kernelversion command, simply open a terminal and type the following command:

$ kernelversion

This will print the major version number of the current kernel to the terminal. For example, if the current kernel version is 5.4.0-73-generic, the output of the kernelversion command will be:

5

This command can be useful in a variety of situations, such as when troubleshooting kernel-related issues or when checking for compatibility with certain software packages.

Options

The kernelversion command does not have any options or arguments.

Troubleshooting Tips

If the kernelversion command does not return any output, it may be because the command is not installed on the system. To install the command, use the following command:

$ sudo apt install linux-version

If the command still does not work after installation, it may be because the current kernel version is not supported by the command.

Notes

  • The kernelversion command only prints the major version number of the kernel. To get more detailed information about the kernel, use the uname -a command.
  • The kernelversion command is only available on Linux systems that use the proc filesystem.