• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

lsb_release Command Examples in Linux

by admin

The minor version of RHEL server is defined by the /etc/redhat-release file and it belongs to redhat-release-server package. The lsb_release script points to /etc/redhat-release which gives the same output as ‘cat /etc/redhat-release’. Linux Standard Base (LSB) is basically a standard that multiple distributions sign up to. It specifies a Filesystem Hierarchy Standard (FHS), as well as various other components of a Linux system.

You might have noticed the Ubuntu usage of lsb_release to grab its OS version; the same can be done on CentOS, but first, lsb_release needs to be installed:

# yum install redhat-lsb-core

Now, we can run the same command that Ubuntu uses in order to get OS information:

$ lsb_release -s -d
"CentOS Linux release 7.5.1804 (Core) "

The same can be done on Debian, without having to install anything by default:

$ lsb_release -s -d
Debian GNU/Linux 9.5 (stretch)

lsb_release Command Examples

1. To get the LSB distribution information:

# lsb_release  

2. To get all the LSB distribution information:

# lsb_release -a
# lsb_release --all 

3. To display the string id of the distributor:

# lsb_release -i
# lsb_release --id 

4. To display the single line text distribution:

# lsb_release -d
# lsb_release --description 

5. To display the release number of the distribution:

# lsb_release -r
# lsb_release --release 

6. To Display the codename according to the distribution release:

# lsb_release -c
# lsb_release --codename 

7. To Use short output format for information requested:

# lsb_release -s
# lsb_release --short 

8. To get the help:

# lsb_release -h
# lsb_release --help 

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 7 : unable to start vsftpd service
  2. Understanding rsyslog Filter Options
  3. How to change the default permissions on /var/log/audit/audit.log file in CentOS/RHEL
  4. Tutorial on Linux Clustering (High Availability)
  5. usermod Command Examples in Linux
  6. Linux “seq” Command Examples
  7. How to set “max_report_luns” and “max_luns” on CentOS/RHEL 7 to scan more than 16,383 LUNs
  8. Beginners Guide to DHCP – Install and configure DHCP server and client
  9. CentOS / RHEL 7 : How to create an Network Bonding (NIC teaming) using nmcli
  10. CentOS / RHEL 7 : How to follow the mount order in /etc/fstab

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright