How to: Check the operating system version in linux

When troubleshooting hardware and software issues in a linux environment, identifying the distribution name (Ubuntu, Red Hat, Fedora), release number and codename can be invaluable. A ‘quick google’ for an error message without including such information can often lead to irrelevant and mis-leading results. Including these details can often provide far more helpful results as they are usually quoted alongside reported issues and hopefully the fixes for them.

The ‘cat’ (concatenate) command can be run from a linux shell and can be used to display the contents of individual or multiple files.

$ cat [OPTION] [FILE] ...

We can use this command to combine and display the files which give us release information found in /etc/ by using the following command:

$ cat /etc/*-release

In this example we can see the operating system is Ubuntu release 14.04 LTS (trusty) and some extra support information:

administrator@individualtechsupport.co.uk:~$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.4 LTS"
NAME="Ubuntu"
VERSION="14.04.4 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.4 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

Be the first to comment on "How to: Check the operating system version in linux"

Leave a comment

Your email address will not be published.


*


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