How to View the Linux Distribution Name Using os-release

Unlike Windows or macOS, Linux comes in hundreds of different versions, known as distributions (or “distros”). Ubuntu, Fedora, Debian, Linux Mint, and Arch are all Linux, but they use different package managers, configurations, and release cycles.

If you take over administration of a remote server or start working on an unfamiliar machine, you must know exactly which distribution you are using before you can safely install software or modify system settings.

In this guide, you will learn how to view your Linux distribution name and version using the os-release file.

How to Read the os-release File

The most universally reliable way to check your OS version on modern Linux systems (anything using systemd) is to view the contents of the /etc/os-release file. This file contains standardized identification data about the operating system.

  1. Open your Linux terminal.
  2. Type the following command using the cat utility to read the file:
    cat /etc/os-release
  3. Press Enter.

The terminal will print a block of text containing several variables. A typical output will look something like this:

PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
ID=ubuntu
ID_LIKE=debian

Understanding the Output

Here is what the most important fields mean:

  • PRETTY_NAME: The human-readable name of the distribution, including the version number and release type (e.g., LTS for Long Term Support). This is usually the only line you need.
  • NAME: The short name of the OS.
  • VERSION_ID: The specific numerical version.
  • ID_LIKE: This is highly useful. It tells you the parent distribution. If you are using Linux Mint, the ID_LIKE field will say ubuntu, telling you that you can use Ubuntu tutorials and APT commands to manage the system.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.