There are a few handy terminal commands we can use to obtain all the relevant information about the operating system installed on a Linux system. Of course, you can also check from GUI, though the method may vary depending on what desktop environment you are running.
What Comprises a Linux System
Asking “What version of Linux am I running?” could generate a few different answers. It depends on what information you’re looking for exactly. For example, do you want to know the version of the Linux kernel or just find out what distribution is installed?
Linux is comprised of multiple components, all with their own version names and numbers. All of the following would need to be included in a complete answer to the question of “What version of Linux is this?”:
- The version of the Linux kernel
- The distribution that is installed (i.e. Ubuntu, Fedora, Mint)
- The version of the distribution
- The edition of the operating system (i.e. Ubuntu Desktop vs. Ubuntu Server)
- The CPU architecture that the OS utilizes (32-bit or 64-bit)
- The desktop environment running (i.e. GNOME, KDE, Xfce)
Now, let’s move on to answering each of these points.
Check System Version with Terminal Commands
hostnamectl command will tell you the operating system, kernel, CPU architecture, and other various information:
In our Ubuntu test system, it also shows us the version of our operating system, “Ubuntu 20.04 LTS.” However, some distributions are not always specific enough to include the version number here. Take this screenshot from Manjaro for instance, where it only tells us the distribution name:
lsb_release command will give you some pretty specific information about your distribution version and even its codename. However, not every distribution comes with the correct package installed by default to run this command.
3. You can take a peek inside the
/etc/os-release file, which almost always contains adequate information about your OS. Here we run the command on a CentOS system.
You could also try this command, which will check that directory’s other pertinent files for even more information:
4. If you just want to see the Linux kernel version and don’t need the other information, the quickest way to obtain that will be with the
5. The commands above ought to suffice, but here’s one more for good measure: the
Check System Version with GUI
If you are running a GUI, you can undoubtedly find information about your operating system in there as well. The instructions for finding it will vary depending on what desktop environment you’re running. In GNOME on Ubuntu, the information can be found in Settings > About.