How to see Ubuntu version in Linux terminal
- Last updated: Nov 3, 2023
- Views: 170
- Author: Admin
Every Linux system administrator should know what version of the operating system he has because at any time this information may be needed, especially if you work with servers that do not have a graphical interface. If you know your version of Ubuntu, it will be much easier for you to figure out which packages or applications to install.
In this article, I will show you different ways to check your Ubuntu version through the command line terminal.
lsb_release -a command
The fastest way to find out your current version of Ubuntu is to use the command:
$. lsb_release -a
Your version of Ubuntu will be shown in the Description bar. As you can see from the output above, I am using Ubuntu 22.04.1 LTS.
lsb_release -d command
Instead of displaying all the information, you can display only the description line by passing the -d option instead of the -a option.
$. lsb_release -d
You can also find out the Ubuntu version using the /etc/issue file. Use the cat command to display the contents of a file.
$. cat /etc/issue
Another option for viewing the Ubuntu version is the /etc/os-release file. The /etc/os-release file contains the operating system credentials. You can only find this file in newer versions of Ubuntu running systemd .
$. cat /etc/os-release
At the very end, you can also use the hostnamectl command. The hostnamectl command allows you to set the hostname, but you can also use it to check your version of Ubuntu.
Thank you all, I hope my article was of some help to you.