About Linux FAQ

Browse More FAQs:

Find out my Linux distribution name and version

Posted by Vivek Gite [Last updated: October 25, 2007]

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:

Discussion on This FAQ

  1. nitin Says:

    But how to find version of other unix systems like FreeBSD. cat /etc/*-release won’t give it

  2. al Says:

    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.

  3. Richard Navarrete Says:

    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

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!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , ,

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.