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"
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- My 10 UNIX Command Line Mistakes
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!
- Email FAQ to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: 10/25/07



{ 11 comments… read them below or add one }
But how to find version of other unix systems like FreeBSD. cat /etc/*-release won’t give it
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.
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
Thanks Richard,
cat /proc/version worked for me..
Thanks alot ! all commands gave some good info about my sys.
And “cat /etc/issue” as well, for my ubuntu 8
thanx richy!!!it works
Thanks for the quick command. Worked perfectly.
hi guys,
can this kind of file which contains the version info be modified? for example when I want to remaster Ubuntu to new name with my name: Maxx
do we just to modify a file? or what should we do?
thanks in advance!
hai ,
i read ur information for linux.but, i want “what r the different versions available in linux”.please give ans immediately
Please specify the which Linux ? Redhat or else….
Also try
uname -a