• 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. cut: command not found
  2. How to re-create the yum cache (force a fetch of the cache data) from enabled repositories in CentOS/RHEL
  3. isoinfo Command Examples in Linux
  4. paste Command Examples in Linux
  5. Replacing a Failed Mirror Disk in a Software RAID Array (mdadm)
  6. How to Set External Network For Containers in Linux Containers (LXC)
  7. ‘ulimit: max user processes: cannot modify limit:operation not permitted’ Shown When Login
  8. date Command Examples in Linux
  9. The System Continuously Displayed the Error Message from the “avahi-demon” in /var/log/messages
  10. Linux interview questions – Special permissions (SUID, SGID and sticky bit)

You May Also Like

Primary Sidebar

Recent Posts

  • pw-cat Command Examples in Linux
  • pvs: command not found
  • pulseaudio: command not found
  • pulseaudio Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright