The “lsb_release” (Linux Standard Base) command displays the basic information of a particular Linux operating system. This command shows the system information, such as version, codename, distribution, and many others. Moreover, the “lsb_release” command also contains a list of supported options.
In the following post, the purpose, working, and functionality of the lsb_release command will be explained in detail.
The outline of this post is illustrated below:
- What is Isb_release Command in Linux?
- How to Use lsb_release Command in Linux?
- Bonus Tip: Alternative of lsb_release Command
Let us start with the post.
What is Isb_release Command in Linux?
The lsb_release (Linux Standard Base) command offers basic information about the respective Linux distribution. The working of the command depends on the following syntax:
Syntax:
The basic syntax of the “lsb_release” command is defined below:
$ lsb_release [OPTIONS]
The “lsb_release” is the main keyword in the command, and the square brackets show its supported options. These supported options and their usage are listed below.
Options | Description |
---|---|
Isb_release -a | Version, codename, release, and description about the system. |
Isb_release -s | It displays the requested information in a short format. |
Isb_release -c | It identifies the codename of the installed Linux distribution. |
Isb_release -h | It denotes all the options of the lsb_release command |
Isb_release -i | It represents the ID of the Linux distribution, i.e., Debian, Ubuntu…. |
Isb_release -v | It can be utilized to check the version of the current Linux operating system and its distributions. |
Isb_release -d | It refers to the description of the currently installed Linux distribution |
Isb_release -r | It shows the release number of the distribution. |
For a piece of basic information about the usage of these options, execute the following command:
$ lsb_release --help
Now, Let’s head to the usage of this command.
How to Use lsb_release Command in Linux?
The main objective of the “lsb_release” command is to display the basic information of the entire Linux system. However, it contains some supported options that display the required specific information. In this section, you will learn to understand the practical usage of the “ls_release” command:
Example 1: Complete Information About the System
Using the “a” option of the command, you will get all the basic information about the Linux distribution you are using. Usually, this variant of the “lsb_release” command is used the most:
$ lsb_release -a
Example 2: Get the LSB Module Information
The “lsb_release -s” command displays only the information related to the “LSB” module as can be seen below:
$ lsb_release -s
The same output can be retrieved using the “-v” option as follows:
$ lsb_release -v
Example 3: Check the CodeName of the Linux Distribution
The “lsb_release -c” command verifies the codename of Linux operating system or its distribution. In our case, it is “jammy” on Ubuntu 22.04:
$ lsb_release -c
Example 4: Check the Distributor
The “lsb_release -i” command tells us the distributor ID i.e Ubuntu, Redhat, CentOS:
$ lsb_release -i
Example 5: Display Distributor Description
The “lsb_release -d” represents the description in a single line of Linux system and its distributions:
$ lsb_release -d
Example 6: Display the Distribution Release Number
The “lsb_release -r” denotes the release no of the Linux operating system:
$ lsb_release -r
This is all about the “lsb_release” command.
Bonus Tip: Alternative of the lsb_release Command
In the Linux operating system and its distributions, the “ /etc/os-release” file also contains information regarding the system. To view its content, you can use the following command:
$ cat /etc/os-release
The output shows that detailed information is provided about the system.
That’s all about this post.
Conclusion
The “lsb_release” (Linux Standard Base) command offers information about the Linux system and the LSB module. The general syntax of the Linux “lsb_release” command is “$ lsb_release” and the most used variant of this command is “$ lsb_version -a”. This post has briefly outlined the working and usage of the “lsb_release” command with practical examples.