Oct 26, 2023 3 min read

What is lsb_release Linux Command

Learn lsb_release Linux Command with our step-by-step tutorial. This command shows system details, including version and distribution.

lsb_release Linux Command
Table of Contents

Introduction

Before we begin talking about lsb_release in Linux Command, let's briefly understand – What is lsb_release?

Using the "lsb_release" command, which stands for "Linux Standard Base," you can view the fundamental data of a certain Linux operating system. This command displays system details including version, codename, distribution, and many more. In addition, the "lsb_release" command includes a list of supported options.

In this tutorial, you will understand lsb_release Linux Command. We will also address a few FAQs on lsb_release Linux Command.

What is Isb_release Command on Linux?

The lsb_release (Linux Standard Base) command provides basic information about the selected Linux distribution. The following syntax is necessary for the command to function:

Syntax:

The "lsb_release" command's general syntax is described below:

lsb_release [OPTIONS]

The command's primary keyword, "lsb_release," and its supported options are displayed in square brackets. The following is a list of the supported options and how they are used.

OptionsDescription
Isb_release -aThe system's version, codename, release, and description.
Isb_release -sIt provides the needed details in a condensed format.
Isb_release -cThe distribution of Linux that is installed is identified by its codename.
Isb_release -hIt indicates every lsb_release command option.
Isb_release -iIt stands for the Linux distribution ID, such as Debian or Ubuntu.
Isb_release -vIt can be used to check the distributions' and the current version of the Linux operating system.
Isb_release -dIt pertains to the description of the Linux distribution that is currently installed.
Isb_release -rIt displays the distribution's release number.

Run the following command to get some basic information on how to use these options:

lsb_release --help

Let's move on to how to use this command.

How to Use lsb_release Command on Linux?

The "lsb_release" command's primary goal is to present the fundamental data for the complete Linux system. It does, however, have several supported options that show the exact information that is needed. You will learn how to use the "ls_release" command in practise in this section.

Example 1: Complete Information About the System

You may learn all the essential details about the Linux distribution you are using by using the command's "a" option. Typically, this variation of the "lsb_release" command is used the most:

lsb_release -a

Example 2: Get the LSB Module Information

As seen below, the "lsb_release -s" command only shows data relevant to the "LSB" module:

lsb_release -s

With the "-v" option, you can get the same output as below:

lsb_release -v

Example 3: Check the CodeName of the Linux Distribution

The "lsb_release -c" command confirms the distribution or operating system's codename. It is "jammy" in our instance on Ubuntu 22.04:

lsb_release -c

Example 4: Check the Distributor

The distributor ID, such as Ubuntu, Redhat, or CentOS, is provided via the "lsb_release -i" command:

lsb_release -i

Example 5: Display Distributor Description

The description of the Linux system and its distributions is represented by the command "lsb_release -d" in a single line:

lsb_release -d

Example 6: Display the Distribution Release Number

The release number of the Linux operating system is indicated via "lsb_release -r":

lsb_release -r

That's it about the "lsb_release" command.

Bonus Tip: Alternative of the lsb_release Command

The "/etc/os-release" file in the Linux operating system and distributions also contains system information. You can use the following command to view its content:

cat /etc/os-release

The output indicates that detailed information on the system is provided.

FAQs on lsb_release Linux Command

How do I check the version of my Linux distribution using "lsb_release"? 

You can check the version of your Linux distribution by running the command: lsb_release -a or lsb_release -d.

Can "lsb_release" display only the distribution ID? 

Yes, you can use the command lsb_release -i to display only the distribution ID.

How can I print just the release number using "lsb_release"? 

You can use the command lsb_release -r to print only the release number.

Is it possible to check the codename of my Linux distribution using "lsb_release"? 

Yes, the command lsb_release -c can be used to display only the codename of the Linux distribution.

Can I use "lsb_release" to check whether I am running on a 32-bit or 64-bit system? 

No, "lsb_release" does not provide information about the architecture or bitness of the system. You can use the "uname" command instead, like uname -m.

Does the "lsb_release" command require root or sudo privileges? 

No, you can run the "lsb_release" command without root or sudo privileges.

Can "lsb_release" be used in scripts or automated tasks? 

Yes, "lsb_release" is often used in scripts or automated tasks to obtain specific information about the Linux distribution being used.

Conclusion

The "lsb_release" (Linux Standard Base) command provides details about the LSB module and the Linux operating system. The most popular version of the Linux "lsb_release" command is "$ lsb_version -a," and its general syntax is "$ lsb_release". This tutorial has covered the basics of the "lsb_release" command and how to use it.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to DevOps Tutorials - VegaStack.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.