How to Check Ubuntu Version Using the Command Line

The frequent updates released by the manufacturing company make various changes to the Operating System. In Linux OS, its various distributions such as Ubuntu update frequently. The interface may be the same but the version differs in functionality. It is required to check which version is installed on your system. This article will help to provide information on how the current version of your Ubuntu operating system can be checked.

Verify Ubuntu Version Using Command Line

There are different methods in which the command line can be utilised to check which version of Ubuntu the system is currently running. Below are some of the most commonly utilised methods for checking the Ubuntu operating system.

Method 1: Using the “lsb_release” Tool

The first and most common method is to make use of a tool named lsb_release. This utility comes built-in inside the Ubuntu system, to check the version of your operating system simply run the command shown below:

$ lsb_release -d

As shown in the snippet above, the “lsb_release”tool along with the “-d” option displays the exact version of the operating system that is being used. If you are looking for further details about the system, you can use the “-a” option which will display all the major information as shown below:

$ lsb_release -a

Method 2: Access the “/etc/issue” File

how to handle linux files and direc...

There exists a file in the system which contains the current version of the operating system. The “cat” command can be used to access and output the content inside the file. The command for this is provided below:

$ cat /etc/issue

Method 3: Access the “/etc/os-release” File

Another method involves the use of a file that is very similar to the one used in the previous method. The only difference is that this file only exists in Ubuntu systems that are running version 16.04 or higher than that. Also different from the previous file, this file contains a lot more details about the system, much more than just its version. The “cat” command for this file is as follows:

$ cat /etc/os-release

Method 4: Using the “hostnamectl” Command

Another common command that can be utilised for checking the system’s current version is the “hostnamectl” command. This can be used in the terminal as shown below:

$ hostnamectl

You have gone through the primary command line utilities that can be used to check the Ubuntu version. The Ubuntu version can also be verified using the GUI.

Bonus-Tip: Check Ubuntu Version Using GUI

Aside from the terminal commands, the GUI can also be used to check the current version of the Ubuntu operating system. The first step is to open the Settings app as shown below:

Once the Settings window opens, click on the find and click the about option on the left-hand side as demonstrated:

Once you are in the About section, the current version of the operating system will be displayed on your screen as shown:

Conclusion

There are 4 major methods through which the current version of Ubuntu can be checked. The commands “hostnamectl” and “lsb_release” are often used. The other two are system files “/etc/issue” and “/etc/os-release” which can be displayed since they contain the Ubuntu version in them. This article has provided detailed guidance on which command to use for checking the Ubuntu version using just the terminal.