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!
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:
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
The uname -s command reveals the name of the Kernel. See:
# uname -s
Linux
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
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
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
It is necessary to understand that the Linux Kernel is available in some key features.
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!
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
If you want to discover your machine’s processor, simply use the command with the -p option. Thus:
# uname -p
i686
To discover the system platform, use the -i option:
# uname -i
i386
The uname -o command reveals the operating system in use. Check out the example:
# uname -o
GNU/Linux
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.
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
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.
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:
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.
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.
The sudo command on Linux executes a given command as if it were another user.…
The ss command on Linux is extremely useful for investigating sockets, providing various information about…
Free Linux command shows the amount of total memory in use and available, as well…
The shell has structures for testing conditions and executing certain program sequences several times (loop),…
The /etc/fstab file stores the configuration of which devices should be mounted and what is…
The Netcat Command in Linux or nc is a utility used to do “almost anything”…
This website uses cookies.