How to check Ubuntu version in Linux command line

I am a new Linux system user. How do I check Ubuntu version In Linux command line?

Ubuntu Linux is a free and open source operating system. Knowing your Ubuntu os version and name can be very useful for applying security patches and software updates. This page shows how to find out your Ubuntu Linux version from the CLI and GUI methods.

Check Ubuntu version in Linux

The procedure to find os name and version on Ubuntu Linux:

  1. Open the terminal application (bash shell) by pressing Ctrl+Alt+T
  2. For remote server login using the ssh: ssh user@server-name
  3. Type any one of the following command to find os name and version in Ubuntu:
    cat /etc/os-release
    lsb_release -a
  4. Type the following command to find Ubuntu Linux kernel version:
    uname -r

Let us see all examples in detailed to check your version.

Ubuntu Show Version Number using /etc/os-release file

Type the following cat command:
$ cat /etc/os-release
Sample outputs:

VERSION="18.04.1 LTS (Bionic Beaver)"
PRETTY_NAME="Ubuntu 18.04.1 LTS"

Here is another outputs:

VERSION="20.04 LTS (Focal Fossa)"
PRETTY_NAME="Ubuntu Focal Fossa (development branch)"

Checking your Ubuntu version From the lsb_release terminal command

The lsb_release command gives LSB (Linux Standard Base) and distribution-specific information on the CLI. The syntax is:
$ lsb_release -a
Sample outputs:

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename:	bionic

How to check Ubuntu version using the hostnamectl command

The hostnamectl command may be used to query and change the system hostname and related settings. It can also display your Linux distribution name and kernel version as well:
$ hostnamectl
How To Check Ubuntu Version Using Terminal

Not a fan of the Ubuntu command line? Try GUI

You can see Ubuntu version graphically, i.e. using GUI. Open System Settings by pressing the Super key on your keyboard and type “settings“. Click on Details. You will see version below Ubuntu Logo:

How do I check the version of Ubuntu I am running using GUI?

How do I check the version of Ubuntu I am running using GUI?

Related media


It is a good idea to check your Ubuntu version so that you can apply patches and update versions for security and performance reasons. Ubuntu release cycle is divided into two groups:

  • LTS (Long Term Support) release, which is published every two years in April. For servers and stability reasons, you always need to use LTS.
  • Interim release – Every six months Canonical releases a short version of Ubuntu, which is suitable for cutting edge hardware and desktop users.

To upgrade minor version use the apt command or apt-get command. Learn how to upgrade Ubuntu v16.04 to v18.04 LTS or upgrade Ubuntu v18.04 to v20.04 using the CLI.

You learned how to check your current Ubuntu version through the command-line and GUI. For more info see this page here.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • Daniel Feb 13, 2018 @ 19:50


    For Ubuntu server hosted in AWS or Google cloud. Open the Mac Terminal app. Log in via ssh:
    ssh user@ubuntu-aws-ec2-host-ip
    Enter the command
    lsb_release -a
    My version displayed on the Description line.


Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum