Categories: How-To

How to check the Linux version: complete guide with commands and information

When installing a Linux distribution, it is possible to know which version it is. But in some cases, you may get lost.

For example, if you use a distribution provided by a company or customer and you don’t want to ask them about the Linux version, just follow simple steps.

Not knowing which terminal you are using can cause you problems, after all, some commands are different depending on the distro.

Therefore, in this article we are going to teach you a series of commands via terminal to verify your version of Linux.

Good reading!

Check the Linux version and other information with the uname command

The uname command is responsible for displaying the main information of the Linux system. Using it, it is possible to find out the kernel version, operating system, and other data.

Below, we have separated the main options of the command. Check it out:

Uname command with the -a option (shows all information)

The uname -a command gathers all the information from the system being used. Here’s an example:

# unite -a

Linux linux-7rxb 2.6.25.18-0.2-pae #1 SMP 2008-10-21 16:30:26 +0200 i686 i686 i386 GNU/Linux

Uname command with the -s option (shows the kernel name)

The uname -s command reveals the name of the Kernel. See:

# uname -s

Linux

Uname command with the -n option (shows hostname name)

The uname -n command is capable of showing the name of the location of the machine in question. Check it out in practice:

# uname -n

linux-7rxb

Uname command with the -r option (shows the kernel distribution)

Do you want to discover the Kernel distribution? The uname -r command can help you. So, you’ll see this structure in the terminal:

# uname -r

2.6.25.18-0.2-pae

Uname command with the -v option (shows the kernel version)

From the uname -v command, you can view the Kernel version. Here’s an example:

# uname -v

1 SMP 2008-10-21 16:30:26 +0200

What is the latest version of the Linux kernel?

It is necessary to understand that the Linux Kernel is available in some key features.

  • Pre-patch: pre-patches are like beta versions of the Kernel. Basically, mainline pre-releases are available for developers or interested users. They are tested and then released in a stable version;
  • Mainline: the main line is where all new features are introduced. Every 9-10 weeks, a new mainline version is released;
  • Stable: after the release of the Kernel, it is classified as stable. This version is always updated with bug updates;
  • Longterm: longterm versions don’t need constant updates. In other words, in this type of Kernel, only relevant bug fixes are applied. Releases, in this case, are infrequent.

There are also distribution kernels, that is, they are specific to the version of Linux you are using.

The latest Mainline version is 5.19-rc3, the latest Stable version is 5.18.6, the latest longterm versions are 5.15.49, 5.10.124 and 5.4.200.

To install in a practical way and follow the new updates, visit the official Linux Kernel website!

Uname command with the -m option (shows the hardware name)

Returning to the commands to verify the Linux version, we have the -m option, which is capable of showing the hardware name.

# uname -m

i686

Uname command with the -p option (shows the processor)

If you want to discover your machine’s processor, simply use the command with the -p option. Thus:

# uname -p

i686

Uname command with the -i option (shows the system platform)

To discover the system platform, use the -i option:

# uname -i

i386

Uname command with the -o option (shows the operating system)

The uname -o command reveals the operating system in use. Check out the example:

# uname -o

GNU/Linux

Check Linux version with the cat command

Another way to check the Linux version is to enter the cat command and then access the /etc. directory. This directory stores the main system information.

More specifically, the os-release file is responsible for displaying the distribution name, version, and version name.

In this way, open the terminal and enter the command:

cat /etc/os-release

Not all information displayed from this command is the same for all Linux distributions. But one thing is certain: in any version it is possible to collect the basic data you need.

Check Linux version with the lsb_release command

The lsb_release command is capable of displaying the Linux version. However, it is not available in some distributions. It generally works on Debian-based distros.

The -a option is the one that checks and reveals the Linux version. Thus, the command will be:

lsb_release -a

Check Linux version with the hostnamectl command

There are also other commands to check the Linux version. In this topic, we are going to teach you about hostnamectl.

Most of the current Linux distributions use systemd. Within the system, it is possible to use the command in question.

Although the command focuses on the host name, the information displayed also includes the machine ID, system version, Kernel version, and architecture.

What are the versions of Linux Ubuntu?

There are many versions of Linux Ubuntu, registered since 2004. The first version, for example, was Ubuntu 4.10.

The versions with Long Support Time (LTS), in order of release, are:

  • Ubuntu 6.06 LTS;
  • Ubuntu 8.04 LTS;
  • Ubuntu 10.04 LTS;
  • Ubuntu 12.04 LTS;
  • Ubuntu 14.04 LT;
  • Ubuntu 16.04 LTS;
  • Ubuntu 20.04 LTS.

The latest versions released are 20.10, 21.04, 21.10 and, the most recent, 22.04 LTS.

Therefore, we recommend that this version be the one installed because, in addition to being the newest, it will also be supported for a long time.

Do you want to dive deeper like a Linux professional?

Discover the variety of our Linux courses, from preparation for official certifications such as the LPIC, to courses to learn specific skills and boost your career.

Conclusion

Now you have several solutions to verify the Linux version. If any of the commands don’t work, try all the options that we provide.

Uirá Endy Ribeiro

Uirá Endy Ribeiro is a Software Developer and Cloud Computing Architect with a 23-year career. He has master's degrees in computer science and fifteen IT certifications and is the author of 11 books recognized in the IT world market. He is also Director at Universidade Salgado de Oliveira and Director of the Linux Professional Institute - LPI Director's Board.

Uirá Endy Ribeiro

Uirá Endy Ribeiro is a Software Developer and Cloud Computing Architect with a 23-year career. He has master's degrees in computer science and fifteen IT certifications and is the author of 11 books recognized in the IT world market. He is also Director at Universidade Salgado de Oliveira and Director of the Linux Professional Institute - LPI Director's Board.

Share
Published by
Uirá Endy Ribeiro
Tags: linuxversion

Recent Posts

Sudo command on Linux (privilege scale) [Basic Guide]

The sudo command on Linux executes a given command as if it were another user.…

2 years ago

SS command on Linux (investigate the network) [Basic Guide]

The ss command on Linux is extremely useful for investigating sockets, providing various information about…

2 years ago

Free Linux command (memory usage) [Basic Guide]

Free Linux command shows the amount of total memory in use and available, as well…

2 years ago

Linux while command (loop – while) [Basic Guide]

The shell has structures for testing conditions and executing certain program sequences several times (loop),…

2 years ago

Linux fstab file (disk mount setup) [Basic Guide]

The /etc/fstab file stores the configuration of which devices should be mounted and what is…

2 years ago

Netcat command on Linux (Swiss network knife) [Basic Guide]

The Netcat Command in Linux or nc is a utility used to do “almost anything”…

2 years ago

This website uses cookies.