How to query your Linux system kernel

How much can your Linux system tell you about the kernel it’s running and what commands are available to help you ask? Let’s run through some of them.

uname

The simplest and most straight-forward command for providing information on your kernel is the uname -r command. It provides a succinct answer to your question, but in a format that also includes a number of fields each which provides a particular piece of information.

$ uname -r
4.15.0-30-generic
^  ^ ^  ^    ^
|  | |  |    |
|  | |  |    |
|  | |  |    +-- the distribution-specific string
|  | |  +------- the latest bug fix
|  | +---------- the minor revision
|  +------------ the major revision
+--------------- the kernel version

Add an “s” and your output will include the kernel’s name:

$ uname -sr
Linux 4.15.0-30-generic

In the first display above, you can see that each field has been annotated. If you use, the uname -a command instead, you will get quite a bit more information. In the display below, each of the fields is explained. Notice that the third field shows the same information we see above. The output is wrapped around below to make it easy to label the fields.

Source link