5 Ways to Check the Linux Version

Are you wondering how to check the Linux version that you are running on your system? Let's show you various ways you can fish out the OS details.

When most people talk of Linux, they are always referring to a Linux distribution. However, this is not the case. Linux itself is a kernel which acts as a bridge between user applications and the hardware. When we talk of a Linux distribution, we refer to an operating system developed from the Linux kernel. A distribution comes with a package manager, pre-installed applications, a Desktop Environment, and several more features.

Some of the popular Linux distributions include; Ubuntu, Fedora, Manjaro, CentOS, Kali Linux, Linux Mint, and more. In this post, I will use a Linux distribution called Parrot. It is one of the many penetration testing distros available. Others include Kali Linux, Backbox, etc.

Knowing the Linux version running on your machine will help you a great deal. For example, understanding which Linux distribution you are using will determine how you install your applications and packages. That is because every Linux distribution comes with its package management system.

In this post, you will learn how to check your Linux distribution, its version, and the kernel using the command-line.

Check the Linux Version

There are several terminal commands that you can execute to know your Linux version and distribution.

1. The “lsb_release” command

The lsb_release is a utility that provides Linux Standard Base (LSB) information about the distribution you are using. This command should work on all Linux distribution, which has the lsb_release package installed.

Execute the command below in the Terminal.

lsb_release -a

lsb_release utility
lsb_release utility

From the output shown in the image above, the ‘Description’ value shows I am currently running Parrot GNU/Linux 4.7.

If you wanted only to display this description information, including the ‘-d’ parameter instead of ‘-a.’ See the command below.

lsb_release -d

lsb_release utility
lsb_release utility

To list other arguments you can use with the “lsb_release” utility, use the ‘–help’ option as shown below.

lsb_release --help

lsb_release help command
lsb_release help command

If you get an error like “command not found: lsb_release” don’t worry, there are still other commands we can use to determine your Linux version.

2. Display “/etc/os-release” file contents

Another method you can use to know your Linux distribution and version is checking the contents of the ‘os-release‘ file in the ‘/etc. ‘ directory. You can use the ‘cat’ or ‘less’ command to display the contents.

cat /etc/os-release
less /etc/os-release

os-release file
os-release file

3. Display “/etc/issue‘ file contents

Another way is displaying the contents of the ‘issue‘ file in the ‘/etc.’ directory. It holds the system identification text displayed before login. Run the command below.

cat /etc/issue

issue file
issue file

4. The “hostnamectl” command

Another powerful utility we can use is ‘hostnamectl.’ It displays information about the Linux distribution, version, kernel, and more. You can also use it to change the hostname.

hostnamectl

hostnamectl
hostnamectl

5. The “uname” command

The uname command shows information like the kernel architecture, version, name, and release. Execute the command below.

uname -srm

uname
uname

Additional Commands…

If the above commands don’t work for, you will probably run an old or outdated Linux distribution. However, this doesn’t mean its dead end for you. Try any of the commands below;

cat /etc/*release
cat /etc/*version

outdated Distributions
outdated Distributions

Conclusion

Those are four ways you can use to check your Linux version. My favorite method is using the “hostnamectl” command. I find it more comfortable and convenient. What about you? Feel free to tell us below.

Arun Kumar
Arun did his bachelor in computer engineering and loves enjoying his spare time writing for FOSS Linux. He uses Fedora as the daily driver and loves tinkering with interesting distros on VirtualBox. He works during the day and reads anything tech at night. Apart from blogging, he loves swimming and playing tennis.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,054FansLike
407FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

MUST READ

The hierarchy tree of Linux Mint makes it an Ubuntu-based Debian-based Linux distribution that is community-driven. This historical and developmental attribute of this Linux distro makes it an ideal candidate to offer free and open-source bundled applications to a vast range of its Linux community users. Additionally, after completing out-of-the-box multimedia support, users directly benefit from its proprietary software support through multimedia codecs.
The innovative strides of email services came as a faster alternative for the postal services. However, it does not imply that the growing use and embrace of email services have contributed postal services to the messaging world obsolete, for not all messages are transmitted through words.