finding codename debian

michalmam's picture

Forums: 

Hi,
I need find code name of my debian distribution, i try cat /etc/debian_version and I get the number of my version ( 5.0.8 ), but I need the code name. Is there any command to find it in debian? Thanks

Re: finding codename debian

1's picture

If you type this in your web-browser:
http://www.google.co.uk/search?q=debian 5.0&num=%i&ie=utf-8&oe=utf-8

you'll get the codename

Biggrin sorry, i couldn't resist!

Re: finding codename debian

michalmam's picture

Smile I know 5.0 is lenny, but I need any unix command for this finding becouse I want to use it in "if statement" in my program by the debian code name.

Re: finding codename debian

1's picture

the only identification file i know about is debian_version in /etc, and here you only get a version number. Other than that, your apt might be set up so that the sources.list contain codenames instead of generic stable/testing/unstable. I don't think this file is a reliable way to detect a version. Perhaps something in /proc, or /var ?