Knowledgebase

How to Check the Ubuntu Version in Windows CMD?

If you are using Ubuntu on Windows through WSL (Windows Subsystem for Linux), knowing your Ubuntu version is very important!

Why?

Because many commands, software installations, and updates depend on the exact Ubuntu version you are running.

The good news is, you don’t need to open a separate Ubuntu terminal to check this. You can easily find your Ubuntu version directly from the Windows Command Prompt (CMD).

In this guide, we will walk you through simple, reliable steps to check your Ubuntu version using Windows CMD.


Also Read: How to Check React Version in Windows CMD?


Prerequisites

Before starting, make sure:

  •  WSL is installed on your Windows system.
  •  Ubuntu is installed via WSL.
  •  You can open Command Prompt (CMD).

Methods to Check the Ubuntu Version in Windows CMD

There are 3 methods to check the Ubuntu Version in the Windows Command line, through which you can check:

Method 1: Check Ubuntu Version Using the lsb_release Command

The lsb_release command displays official distribution information of your Ubuntu system. It is designed specifically to show Linux distribution details such as version number, release name, and codename.

This is the cleanest and most user-friendly method, making it ideal for beginners.

Step-by-Step Process

  •  Open Command Prompt (CMD).
  •  In that, you have to enter the following command:
Copied!
wsl lsb_release -a


How This Command Works:

★ wsl tells Windows to execute the command inside the Linux environment.

lsb_release fetches Linux distribution details.

-a means “show all available information.”

➔ Press Enter after adding this command

You will get this output:

Copied!
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:      jammy

➢ What This Shows:

  •  Description → Full Ubuntu version
  •  Release → Version number
  •  Codename → Ubuntu release name

➢ When to Use This Method

  •  When you want clear and complete version details.
  •  When troubleshooting software installation issues.
  •  When following tutorials that require a specific Ubuntu version.


Also Read: How to Check Laravel Version in Windows CMD?


Method 2: Check Ubuntu Version Using /etc/os-release

Ubuntu stores its operating system details in a system file called /etc/os-release. This file contains raw OS information read directly from the system.

This method is very reliable and works even if certain Ubuntu tools are missing.

➢ Step-by-Step Process

  •  Open Command Prompt.
  •  Run the following command & press Enter:
Copied!
wsl cat /etc/os-release

How This Command Works:

  •  cat is used to display file content.
  •  /etc/os-release is a system file that stores OS version details.
  •  wsl runs the command inside Ubuntu from Windows CMD.

You will get this output:

Copied!
NAME=”Ubuntu”
VERSION=”22.04.3 LTS (Jammy Jellyfish)”
VERSION_ID=”22.04″

➢ What You Learn From This Output

  •  VERSION → Full Ubuntu version name.
  •  VERSION_ID → Exact release number.
  •  NAME → Linux distribution name.

➢ When to Use This Method

  •  When the lsb_release command is not available.
  •  When you need system-level OS details.
  •  When working on advanced troubleshooting.

Also Read: Guide to Check MongoDB Version in Windows CMD


Method 3: Check Ubuntu Version for a Specific WSL Distribution

If your system has multiple Linux distributions installed (such as Debian, Kali, or multiple Ubuntu versions), this method ensures the command runs only for Ubuntu.

Step-by-Step Process

  •  Open Command Prompt.
  •  In that, run the following command & press Enter:
Copied!
wsl -d Ubuntu lsb_release -a

How This Command Works:

  •  -d Ubuntu specifies the Ubuntu distribution.
  •  Prevents confusion when multiple Linux distributions are present.
  •  Ensures accurate version output.

When to Use This Method

  •  When multiple WSL distributions are installed.
  •  When managing more than one Ubuntu instance.
  •  When scripting or automating version checks.

Also Read: Guide to Check Node Version in Windows CMD


Conclusion

Knowing how to check your Ubuntu version from Windows CMD gives you better control over your system. Whether you prefer a clean command like lsb_release, a system-file approach, or a distribution-specific method, each option ensures accurate version details.

These simple commands can save hours of troubleshooting and help you work confidently with Ubuntu on Windows. Once you know your version, everything, from updates to installations, becomes smoother and more reliable.