Written by Tech Notes
Category: Servers
Published: 26 May 2015
Servers   OS.   Linux   Fedora   Centos   RHEL   RedHat   Ubuntu   Suse   Debian   Slackware   Unix   OS Distribution   Kernel   BSD   FreeBSD   Solaris   Sun  

How To Figure Out Version Of Linux/Unix/Debian/BSD Installed (Distribution, Version, Name)

Here is a list of possibilities, depending on your flavor of Linux or Unix OS.  Simply copy and paste one of the following at command line (i.e. terminal or SSH) to see if it works for you.  I did not have time to organize them into OS categories, as there are too many OSs to research and list.

Please know that I do not get paid to do these articles.  This article took more than 3.5 hours to research and create.

For Redhat Linux, RHEL, Centos, Fedora, slackware, suse, Debian, Ubuntu, FreeBSD, Sun OS, Solaris, general Linux computers, and many other Linux/Unix/Debian/BSD based OSs.

List Of Commands For Various OSs

  1. lsb_release -a

  2. cat /etc/*-release
    cat /etc/*release
    covers more Unix versions

    1. Example outputs for /etc/*-release or .../*rlease:

      Red Hat Enterprise Linux Server release 5 (Tikanga)

      CentOS release 5.4 (Final)

      Fedora Core release 3 (Heidelberg)

      NetBSD 6.1/amd64 and a whole lot of other lines of information.

  3. cat /etc/issue

    1. Example outputs for /etc/*-release or .../*rlease:

      CentOS release 5.4 (Final)

      Fedora Core release 3 (Heidelberg)

  4. more /proc/version
    cat /proc/version

  5. uname -a
    The output for uname willl give information in the following order ["kernel name" hostname "kernel release" "kernel version" "computer/machine/hardware name" "processor type or 'unknown'" "hardware platform or 'unknown'" "operating system"]

  6. cat /etc/*version

  7. Here is an all encompassing command that essentially does /etc/*-release or /*rlease /*version, and more, and regardless which one works on your OS flavor, it pumps out what you need:
    cat /etc/[A-Za-z]*[_-][rv]e[lr]*

  8. more /etc/redhat-release


Notes and Warnings

When getting content of /etc/issue, it may only show the OS version you installed and might not have gotten updated if you upgraded your OS kernel.


Feel Free To Leave A Good Comment. :)

Look around, and you may find other useful articles. Add this site to your Bookmarks/Favorites for easy return for new articles. Consider submitting technical articles for publication, including your embedded links. I will even create a new category if needed.