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)
  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.

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"

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

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?

Related media


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

Posted by: SXI ADMIN

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.


How to KVM, QEMU start or stop virtual machine from command line (CLI)

KVM or Kernel Based Virtual Machine is a popular virtualization technology. It allows you to run virtual guest machines over a host machine. To start...

How to Docker backup Saving and restoring your volumes

Running a Docker volume backup First, we spin up a temporary container, and we mount the backup folder and the target Docker volume to this container....

How to Start and Enable Firewalld on CentOS 7

In this article, we discuss how to start and enable firewalld. It is highly recommended that you have a firewall protecting your server.Pre-Flight CheckThese...