How to Check Your Linux Distro (5 Easy Methods)
Knowing how to identify Linux distributions is a fundamental skill. Distros ship with different features, settings, and configurations. They use different package managers, affecting how software is installed and handled. Some software packages handle well in some distributions and not so well in others. Some share security features not present in others by default. For example, AppArmor is a default security feature included in Debian and Ubuntu distros, not in others like Arch or CentOS. And on goes the list of the differences between various distros.
Thus, knowing the Linux distribution you are handling is crucial in making the right call in system management. In this guide, we explore various ways of identifying a Linux distribution.
#What is a Linux distribution?
A Linux distribution, colloquially called a 'distro', is a complete operating system built on top of the Linux kernel. It comes with an init system, a bootloader, a package manager, and a set of free and open-source software packages, GNU tools, and utilities.
Linux Dedicated Servers with Full Control
Optimize your workloads with customizable Linux bare metal servers, offering high-performance processors, reliable storage, and full root access.
#How to check your Linux distribution
Let’s explore some ways of finding the Linux distribution you are using from the terminal/CLI.
#Using lsb_release command
The lsb_release command displays distribution-specific information, including a particular Linux system's description, release, and codename.
The -a option displays salient distribution-specific details.
lsb_release -a
OutputNo LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble
Pass the -i option to reveal the distribution name.
lsb_release -i
OutputDistributor ID: Ubuntu
The -c option shows the distribution codename.
lsb_release -c
OutputCodename: noble
The -r option displays the release number.
lsb_release -r
OutputRelease: 24.04
#Using the hostnamectl command
The hostnamectl command is both a networking and an information CLI tool. You can run it to configure a static name or display OS details.
Without any flags, it displays a plethora of details, including your Linux distribution:
To check your Linux distribution, run the command:
hostnamectl
You can filter the distribution type by piping the output to the grep filter as follows:
hostnamectl | grep -i 'Operating System'
Operating System: Ubuntu 24.04
#Viewing the /etc/os-release file
The /etc/os-release file is an information-rich text file that contains OS information. The output is rendered in key-value pairs separated by an equals sign. Information displayed to stdout includes OS type, version, and codename.
cat /etc/os-release
In addition, you can also view the `/etc/issue’ file.
cat /etc/issue
OutputUbuntu 24.04 LTS \n \l
#Using the Fastfetch CLI tool
Recall the neofetch tool? It's a CLI information tool that had a good run until it was discontinued on April 24, 2024. It's no longer actively supported, and the project is now archived.
Thankfully, a couple of options are available that mirror the functionality of the Neofetch command. One of the best alternatives is the Fastfetch utility. Fastfetch is an improved version of Neofetch that offers better functionality & features. In addition to what Neofetch displays, it offers information about disk space usage, memory utilization, and even local IPv4 addresses.
Check out the installation instructions for each platform.
Without any command-line options, it displays neofetch-like output, but with additional information such as disk usage, local IPv4 address, battery charge, and locale.
fastfetch
Fastfetch does not come with a configuration file when installed. To generate it, ensure to run the following command:
fastfetch --gen-config
The configuration file is stored in your home directory. You can preview this file using the cat command:
cat ~/.config/fastfetch/config.jsonc
To view or list all of the modules you can use with fastfetch, run the command:
fastfetch --list-modules
This provides a comprehensive list of all the modules that can be invoked from the command line. The list is quite long and includes 73 modules at the time of writing this guide.
Fastfetch lets you choose which modules to print. For example, to display OS information only, run:
fastfetch -s OS
You can provide multiple modules separated by a full colon. For example, to display the OS, kernel, uptime, CPU, disk usage, and local IP details, run the command:
fastfetch -s OS:Kernel:uptime:cpu:disk:localip
You can access the man pages for more information and command options.
man fastfetch
Alternatively, you can preview the help page for a quick reference regarding command-line options.
fastfetch -h
And there you have it. Those are the different methods you can leverage to check your Linux distribution.
#Screenfetch
Screenfetch is a bash script CLI program that displays system information in ASCII format. It is still in active development, and supports a myriad of Linux distributions, Windows, Mac, and BSD systems.
Check out the installation instructions from the GitHub page.
To fetch your Linux distribution information, run the command:
screenfetch
You can get command options for use with screenfetch by viewing the help page.
screenfetch -h
#Conclusion
In this guide, we have covered various ways of checking your Linux distribution, including using the fastfetch tool, a fast, feature-rich, and flexible tool for displaying system information. We hope you can now comfortably check your Linux distribution from the command line.
Starting at just $3.24 / month, get virtual servers with top-tier performance.




