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"
VERSION="7.8"
ID="Linux"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.8"
PRETTY_NAME="Linux Server 7.8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:linux:7:8:server"
HOME_URL="https://linux.oracle.com/"

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

hostnamectl

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 Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

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

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading