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
lsb_release -a
cat /etc/*-release
orcat /etc/*release
covers more Unix versions- 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.
- Example outputs for /etc/*-release or .../*rlease:
cat /etc/issue
- Example outputs for /etc/*-release or .../*rlease:
CentOS release 5.4 (Final)
Fedora Core release 3 (Heidelberg)
- Example outputs for /etc/*-release or .../*rlease:
more /proc/version
orcat /proc/version
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"]cat /etc/*version
- 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]*
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.