Find out my Linux distribution name and version
Q. How do I find out what version of Linux distribution I'm using from the shell prompt?
A. To find out what version of Linux (distro) you are running, enter the following command at the shell prompt:
$ cat /etc/*-release
Output on RHEL 5
Red Hat Enterprise Linux Server release 5 (Tikanga)
Output on Ubuntu 7.10
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.10
DISTRIB_CODENAME=gutsy
DISTRIB_DESCRIPTION="Ubuntu 7.10"
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- How To Hide BIND DNS Sever Version
- Find Linux / UNIX Kernel Version
- How to find which kernel version is installed on my Linux system
- How to: Linux delete or remove kernel
- Howto get Red Hat Enterprise Linux Installation Number
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: , cat_command, codename, enterprise linux, gutsy, linux distribution, linux distro, red hat enterprise, ubuntu



November 4th, 2007 at 4:07 pm
But how to find version of other unix systems like FreeBSD. cat /etc/*-release won’t give it
November 6th, 2007 at 11:25 am
This isn’t exactly a general solution. It assumes the distribution supports some LSB stuff, I think.
For debian and slackware, one could try:
$ cat /etc/*version
On debian stable, lsb-release exists, but just isn’t in /etc/. There is an lsb-release package, and you can run:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 4.0r1 (etch)
Release: 4.0r1
Codename: etch
By the way, lsb_release -a also works on the older Ubuntu version I have.
March 24th, 2008 at 5:48 pm
You can also cat version in proc…
:; cd /proc
;; cat version
Linux version 2.6.9-42.0.3.ELsmp (brewbuilder@hs20-bc1-7.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 SMP Mon Sep 25 17:28:02 EDT 2006