Knowing the Linux version / OS / Kernal details

Linux : Knowing OS details - version
Linux : Knowing OS details - version

Hi All,

Greetings for the day 🙂 LIFE IS BEAUTIFUL 🙂

Background :

  • Recently got a chance to work on Docker
  • So I got the Linux VM from our admin team to play with Docker
  • I am connected to Linux VM using SSH (Secure Shell) and I dont have any details about Linux installed, to download docker and install I want to know the which Linux os and version installed
  • Since I am new to Linux (as hardcore Microsoft Guy 🙂 ) I need to google how to know the respective Linux OS and Version and hence birth of this article 🙂

After bit googling I found three ways to to get the OS details on Linux

Using cat command – execute following command

cat /etc/os-release

Sample output :

NAME="Linux Server"
PRETTY_NAME="Linux Server 7.8"

Linux : Knowing OS details using cat command
Fig : Linux : Knowing OS details using cat command
  • The cat command is used for
    • To display text file
    • To read text file
    • to create new text file
    • File concatenation
    • To combine text and binary files

Using lbs_release command

$ lsb_release -a

Sample output :

LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: LinuxOS
Description:    Linux Server release 7.8
Release:        7.8
Codename:       n/a

Linux : Knowing OS details using lsb_release command
Fig : Linux : Knowing OS details using lsb_release command

Using hostnamectl command


Sample output :

 Static hostname: 
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 
           Boot ID: 
    Virtualization: vmware
  Operating System: Server 7.8
       CPE OS Name: linux:7:8:server
            Kernel: Linux 4.14.35-1902.302.2.el7uek.x86_64
      Architecture: x86-64

 Linux : Knowing OS details using hostnamectl command
Fig : Linux : Knowing OS details using hostnamectl command

Thanks for reading 🙂 Enjoy the beautiful life 🙂 HAVE A SAFE LIFE 🙂 TAKE CARE 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: