1

Possible Duplicate:
How do I find out what version of Linux I’m running?

I need to find out some information about the server os I'm working on.

The release version (e.g. 9.04 if Ubuntu or 4 if RHEL) is important to me and the command uname doesn't show it.

$ uname -a
Linux xxxxxxx 2.6.9-78.0.22.EL #1 Fri Feb 31 25:71:00 EDT 2009 x86_64 GNU/Linux

So: How to get this information via a commandline command?

1

5 Answers 5

8

Most (if not all) modern distributions will include the lsb_release command.

heillinr@mojojojo:~$ lsb_release -r
Release:    9.04
heillinr@mojojojo:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 9.04
Release:    9.04
Codename:   jaunty

Should give you what you are after :)

3

What do you have in /etc/*-release? I have /etc/lsb-release which contains:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.10
DISTRIB_CODENAME=intrepid
DISTRIB_DESCRIPTION="Ubuntu 8.10"

http://linux.about.com/cs/linux101/g/lsbrelease.htm

1

Try

cat /etc/lsb-release

1

I didn't know about lsb_release.

My method for RPM based systems was:

$ rpm -qa | grep release
redhat-release-5Server-5.3.0.3
redhat-release-notes-5Server-25
1

in addition to lsb-release (which is available as lsb-release package under debian), you can look at /etc/debian_version(for debian and derivatives) and /etc/issue for most other distributions.

Not the answer you're looking for? Browse other questions tagged .