Thursday, December 22, 2016

Linux Distribution Information Command



If you want distribution information, it will vary depending on your distribution and whether your system supports the Linux Standard Base. Some ways to check, and some example output, are immediately below.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu Saucy Salamander (development branch)
Release:    13.10
Codename:   saucy

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.10
DISTRIB_CODENAME=saucy
DISTRIB_DESCRIPTION="Ubuntu Saucy Salamander (development branch)"

$ cat /etc/issue.net
Ubuntu Saucy Salamander (development branch)

$ cat /etc/debian_version 
wheezy/sid
References:
http://unix.stackexchange.com/questions/88644/how-to-check-os-and-version-using-a-linux-command

2 comments:

  1. $ hostnamectl
    Static hostname: localhost.localdomain
    Transient hostname: status
    Icon name: computer-vm
    Chassis: vm
    Machine ID: d731df2da5f644b3b4806f9531d02c11
    Boot ID: 384b6cf4bcfc4df9b7b48efcad4b6280
    Virtualization: xen
    Operating System: Red Hat Enterprise Linux Server 7.3 (Maipo)
    CPE OS Name: cpe:/o:redhat:enterprise_linux:7.3:GA:server
    Kernel: Linux 3.10.0-514.el7.x86_64
    Architecture: x86-64

    ReplyDelete
  2. RHEL 7
    $ rpm --query redhat-release-server
    redhat-release-server-7.3-7.el7.x86_64
    RHEL 8
    $ rpm --query redhat-release
    redhat-release-8.0-0.34.el8.x86_64

    ReplyDelete