How to decrypt Linux version information

How to decrypt Linux version information

Displaying and interpreting information about your Linux version is a little more complicated than it seems.

There are many ways to identify a Linux version other than referring to a simple version number. Even a quick look at the output of the uname command can tell you something. What is this information and what does it tell you?

In this article, we'll take a close look at the output of the uname command as well as the version descriptions provided by some other commands and files.

Using uname

Whenever you execute the command uname -a in a Linux system terminal window, a lot of information is displayed. That's because that little a tells the uname command that you want to see all the output that the command can provide. The resulting display will tell you a lot of different things about the system. In fact, each piece of information displayed tells you something different about your system.

For example, the uname -a output looks like this:

$ uname -a
Linux dragonfly 5.4.0-37-generic #41-Ubuntu SMP Wed Jun 3 18:57:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Although this may not be important, you can display the same information using a command that includes all of the uname options in the proper order:

$ uname -snmrvpio
Linux dragonfly 5.4.0-37-generic #41-Ubuntu SMP Wed Jun 3 18:57:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

To break this long list of information into individual chunks, you can use a for loop like this to iterate through each option:

$ for option in snmrvpio; do echo -n "$option: "; uname -$option; done
s: Linux
n: dragonfly
m: x86_64
r: 5.4.0-37-generic
v: #41-Ubuntu SMP Wed Jun 3 18:57:02 UTC 2020
p: x86_64
i: x86_64
o: GNU/Linux

This loop shows what information this option provides. The uname man page provides a description of each option. Here is the list:

  • Linux – Kernel name (options)
  • dragonfly --node name (option n)
  • x86_64 – Machine hardware name (option m)
  • 5.4.0-37-generic – kernel release version (option r)
  • #41-Ubuntu SMP Wed Jun 3 18:57:02 UTC 2020 -- Kernel version (option v)
  • x86_64 – Processor (option p)
  • x86_64 – Hardware platform (option i)
  • GNU/Linux – Operating system (option o)

To delve deeper into the displayed information, look closely at the displayed kernel release data. The 5.4.0-37 in the fourth line is not just an arbitrary string of numbers. Every number matters.

  • 5 indicates the kernel version
  • 4 indicates a major version
  • 0 means minor version
  • 37 indicates the latest patch

Additionally, the #41 in line 5 (kernel version) output in the loop above indicates that this release was compiled 41 times.

If you want to display only one item out of all the information, then the single option may be useful. For example, the command uname -n will tell you just the system name, while uname -r will tell you just the kernel release. These and other options may be useful when inventorying your server or building scripts.

On Red Hat systems, the uname -a command will provide the same kind of information. Here is an example:

$ uname -a
Linux fruitfly 4.18.0-107.el8.x86_64 #1 SMP Fri Jun 14 13:46:34 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Release Information

If you need to know what distribution you are running, the output of uname won't be very helpful. After all, kernel versions are not the same as distribution versions. For this information, you can use the lsb_release -r command on Ubuntu and other Debian-based systems, and on Red Hat you can display the contents of the /etc/redhat-release file.

For Debian systems:

$ lsb_release -r
Release: 20.04

For Red Hat and related systems:

$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.1 Beta (Ootpa)

Using /proc/version

The /proc/version file can also provide information about the Linux version. The information provided in this file has much in common with the uname -a output. Here are some examples.

On Ubuntu:

$ cat /proc/version
Linux version 5.4.0-37-generic (buildd@lcy01-amd64-001) (gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)) #41-Ubuntu SMP Wed Jun 3 18:57:02 UTC 2020

On RedHat:

$ cat /proc/version
Linux version 4.18.0-107.el8.x86_64 ([email protected]) (gcc version 8.3.1 20190507 (Red Hat 8.3.1-4) (GCC)) #1 SMP Fri Jun 14 13:46:34 UTC 2019

Summarize

The Linux system provides a lot of information about kernel and distribution installation. You just need to know where or how to look for it and understand what it means.

This is the end of this article about how to decrypt Linux version information. For more information about decrypting Linux version information, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to view version information in Linux
  • How to get file version information, company name and product name under Linux in Python
  • Solution to the failure of AES encryption algorithm to decrypt in Linux
  • Perfect solution to the problem of aes decryption failure under Linux operating system

<<:  Detailed explanation of keepAlive use cases in Vue

>>:  What does mysql database do?

Recommend

Implementation of MySQL scheduled backup script under Windows

On a Windows server, if you want to back up datab...

Detailed explanation of Linux command file overwrite and file append

1. The difference between the command > and &g...

Mysql implements null value first/last method example

Preface We already know that MySQL uses the SQL S...

Share the problem of Ubuntu 19 not being able to install docker source

According to major websites and personal habits, ...

How to fix abnormal startup of mysql5.7.21

A colleague reported that a MySQL instance could ...

How to Install Xrdp Server (Remote Desktop) on Ubuntu 20.04

Xrdp is an open source implementation of Microsof...

Analyze the difference between ES5 and ES6 apply

Table of contents Overview Function signature Opt...

Example explanation of MySQL foreign key constraints

MySQL's foreign key constraint is used to est...

How to change the CentOS server time to Beijing time

1. I purchased a VPS and CentOS system, and found...

Analysis of Alibaba Cloud CentOS7 server nginx configuration and FAQs

Preface: This article refers to jackyzm's blo...

Detailed explanation of jquery tag selector application example

This article example shares the specific code of ...

A brief analysis of the knowledge points of exporting and importing MySQL data

Often, we may need to export local database data ...

Windows 10 + mysql 8.0.11 zip installation tutorial detailed

Prepare: MySQL 8.0 Windows zip package download a...

MySQL cross-table query and cross-table update

Friends who have some basic knowledge of SQL must...