Home Learn Linux How to check the OS and Linux Version

How to check the OS and Linux Version

by Hend Adel
check OS and Linux version

It is essential to know the currently installed operating system, its version, and also the Linux kernel version on your machine to install the correct packages and apply the appropriate security patches. Not just that, being a system administrator, knowing the system details also comes in handy for troubleshooting issues.

In this guide, we are going to walk you through various methods to determine your Linux version.

Checking the OS and Linux version

We have two main ways:

  • Via a graphical user interface
  • Via the command line way (recommended)

Let’s get started.

Method 1: Graphical User Interface Way

Typically, using a graphical user interface to perform any task is considered the most comfortable way, but you get limited information. Most of the Linux distros have an About or System Information app that should give you necessary OS details. In the below example, we fetch details from the Ubuntu system.

Step 1. From Ubuntu’s top panel, click on the Dropdown arrow.

Open DropDown Arrow

Open DropDown Arrow

Step 2. Click the Settings button to open the settings application.

Press The Settings Button

Settings

Step 3. From the left panel, scroll down and open the Details menu.

Open Details Menu

Open Details Menu

Step 4. From the left panel, select the About option.

Choose the About Option

Choose the About Option

Step 5. You should now see the details of your system. As you see in the below screenshot, I could see RAM size, Processor type, Graphics info, Desktop Environment version (GNOME in my case), OS architecture, and disk size.

Ubuntu Version Using Graphical User Interface

About

Method 2: Command Line Way

This method is the most favorite method among Linux users because sometimes you may be working on a machine that has no graphical user interface installed, such as Ubuntu Server. Note that several commands can be used. We discuss the best commands to use.

lsb command

Launch the Terminal. On Ubuntu machines, this can be done by pressing Ctrl+Alt+T simultaneously. Enter the following command in the Terminal and press enter.

lsb_release -a
Check Ubuntu Version Using lsb Command

Using lsb command

The command will print some details about the currently installed Linux distro. However, if you need to get the current version, only use the -d option with the lsb_release command:

lsb_release -d
Check Ubuntu Version Using lsb -d Option

Check the OS Version Using lsb -d Option

hostnamectl Command

Another command you can use to preview some information about your system is the command used to get the machine hostname.

hostnamectl
Check Ubuntu Version Using hostnamectl Command

Using hostnamectl Command

As you can notice, the hostnamectl command will preview some additional information about your system, including the Linux distro version and Linux Kernel version too.

/etc/issue File

Another way is to open a file in the path /etc/issue file that holes the OS information:

cat /etc/issue
Check Ubuntu Version Using issue File

Using issue File

/etc/os-release File

There is yet another file in the path /etc/os-release that holds some info about the currently installed operating system.

cat /etc/os-release
Check Ubuntu Version Using hostnamectl Command

Using hostnamectl Command

/etc/os-release File

Finally, you can also use the lsb-release File to view the current system version.

cat /etc/lsb-release
Check Ubuntu Version Using lsb-release File

lsb-release File

Conclusion

Those are all the ways you can use to fetch the OS version and Linux version details from your system. I hope the tutorial helped you in learning one or two things about the Linux command-line usage. Feel free to pick the one you feel comfortable with. That’s it for now.

You may also like

Leave a Comment

fl_logo_v3_footer

ENHANCE YOUR LINUX EXPERIENCE.



FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews written by team of expert authors. FOSS Linux is the go-to source for all things Linux.

Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us

Subscribe

©2016-2023 FOSS LINUX

A PART OF VIBRANT LEAF MEDIA COMPANY.

ALL RIGHTS RESERVED.

“Linux” is the registered trademark by Linus Torvalds in the U.S. and other countries.