
How to Check OS Version From Linux/Ubuntu Terminal?
Linux Operating System (OS) offers many distributions, for example, Debian, Ubuntu, Red Hat, Mint, Kali, etc. Knowing a Linux version can be very helpful while installing software packages, applications, security updates, software updates, and updating the operating system. The Operating system information can be viewed in Linux/Ubuntu via command line tools as well as via GUI (Graphical User Interface). Checking the operating system version is essential before installing software to decide if the software is compatible with the current OS version.
This article will demonstrate different methods of checking OS versions via Terminal on Linux/Ubuntu 22.04 systems. This article is organized as follows:
- How to Check/Get the OS Version via cat /etc/os-release File?
- How to Check/Get OS Version via hostnamectl?
- How to Check/Get OS Version via lsb_release?
- How to Check/Get the OS Version via cat /etc/*release File?
- How to Check/Get OS Version via cat /etc/lsb-release File?
- How to Check/Get OS Version via cat /proc/version File System?
- How to Check/Get OS Version via the cat /etc/issue File?
- Bonus Tip: How to Check/Get OS Version via GUI
Let’s begin!
How to Check/Get the OS Version Via cat /etc/os-release File?
The os-release file holds operating system-specific data. To check the operating system version via os-release file, use the cat command as demonstrated in the following code block:
$ cat /etc/os-release

The above output displays the current operating system version, i.e., 22.04.3 LTS (Jammy Jellyfish) along with other operating system data.
How to Check/Get OS Version via hostnamectl?
The hostnamectl command line tool returns the system hostname and other system-related information. To check the operating system version via the hostname command, run the following command:
$ hostnamectl

The above output displays the current operating system version, i.e., Ubuntu 22.04.3 LTS along with other data.
How to Check/Get OS Version via lsb_release?
The lsb_resease command displays the basic information about the installed distribution of the Linux operating system. In this section, the operating system information is checked by using a few flags along with the “lsb-release” command.
To check all Linux distribution information, run the following command:
$ lsb_release -a
Where the “-a” flag indicates all information.
The above output displays the current operating system version, i.e., Ubuntu 22.04.3 LTS along with other version-related data.
To check the description of the installed Linux distribution, run the following command:
$ lsb_release -d
Where the “-d” flag indicates the description of the distribution.
The above output displays the distribution, i.e., Ubuntu 22.04.3 LTS.
To check the release of the installed Linux distribution, run the following command:
$ lsb_release -r
Where the “-r” flag indicates the release number of the distribution.
The above output displays the release of the Ubuntu distribution, i.e., 22.04.
How to Check/Get the OS Version via cat /etc/*release File?
The detailed view of the operating system version information can be checked by accessing the /etc/*release file by executing the following command:
$ cat /etc/*release
Where “*” represents all information about the current Linux distribution.
The above command returns the complete information of the installed Linux distribution. From the output, it can be seen that the current operating system version, i.e., Ubuntu 22.04.3 LTS (Jammy Jellyfish).
How to Check/Get OS Version via cat /etc/lsb-release File?
The lsb-release file contains Linux distribution information like name, release, and codename. To check the operating system version via the “lsb-release” file, use the cat command by using the following syntax:
$ cat /etc/lsb-release

The above output displays the current operating system version, i.e., Ubuntu 22.04.3 LTS along with other distribution-related data.
How to Check/Get OS Version via cat /proc/version File System?
The proc is a virtual file system that is constructed when the system starts and is deleted with the system shutdown. The proc file system holds information about running system processes and system hardware information. To check the operating system version via the “proc” file system, use the cat command followed by the “proc/version” file:
$ cat /proc/version

The above output displays the current operating system version, i.e., 22.04.
How to Check/Get OS Version via the cat /etc/issue File?
The “/etc/issue” file contains the name and version of the operating system. To check the operating system version via the “issue” file, use the cat command by executing the following command:
$ cat /etc/issue

The above output displays the current operating system and its version, i.e., Ubuntu and 22.04.3 LTS respectively.
Bonus Tip: How to Check/Get OS Version via GUI?
A user can check the OS version via GUI conveniently by accessing the Settings via Application Launcher. Settings can be launched by pressing the “Applications” button in the left bottom corner of the screen, then by typing “Settings” in the search bar and by selecting the Settings icon:
The Settings window will be opened. Then, select the About section:
This will redirect to the “About” Ubuntu page, displaying operating system-specific information. The OS version can be verified in the “OS Name” tab.
The above output displays the current operating system name, i.e., Ubuntu 22.04.3 LTS.
Alternatively, the About settings page can be accessed via Terminal by executing the following command:
$ gnome-control-center

This will redirect to the “About” Ubuntu page, displaying operating system-specific information. As seen from the above image, the operating system version can be checked in the “OS Name” tab.
Conclusion
The operating system (OS) Version of a Linux/Ubuntu system can be checked by accessing /etc/os-release, /etc/*release, /etc/lsb-release, and /etc/issue files. Also, hostnamectl and lsb_release commands return operating system version information. Further, the /proc/version filesystem can also be used to check the operating system version in Linux/Ubuntu systems. This article demonstrated seven different methods of checking OS versions via Terminal on Linux/Ubuntu 22.04 systems. Additionally, this article demonstrated how to check the operating system version via GUI.