Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I always wonder this, every time someone gives me access to their server, I always want to find out what distro it is. I figured it'd be more fun to actually type a command rather than asking the admin.

share|improve this question
up vote 14 down vote accepted

On most modern distributions, you can query the Linux Standard Base system with

lsb_release -d

Sample output:

Description:    Debian GNU/Linux 5.0.2 (lenny)
Description:    Ubuntu 9.04
share|improve this answer
LSB toolset seems to always be available in modern distributions, but rarely installed by default... – freiheit Aug 23 '09 at 15:25
@freiheit - I think that says all you need to know about LSB really :-) – Zanchey Aug 24 '09 at 4:12

I answered a similar question on SuperUser.

For most of the popular distributions then,

cat /etc/*{release,version}
share|improve this answer

For distribution name...

cat /etc/issue

For platform...

uname -a
share|improve this answer
/etc/issue is commonly replaced with a banner about authorized access as best practice in a lot of security guides, and common practice in many organizations. – jtimberman Aug 23 '09 at 21:52
yea i overwrite my /etc/issue with ascii art. – Roy Rico Sep 25 '09 at 21:09
haha, excellent :) – nbolton Oct 22 '09 at 17:46

The most reliable for figuring out which linux distribution:

ls -ld /etc/*release* /etc/*version*

Then cat whatever files look interesting from that.

But you probably (as mentioned in another comment already) always want to run uname -a first, in case it isn't even a linux distribution.

share|improve this answer

There is a routine in, that is part of VirtualBox that can be a good starting point.

However, I'd rather ask the sysadmin about this. Apart from the distribution, particular servers can have specific settings and it is frustrating to discover those right after breaking them (not to mention pissing off the sysadmin, that'll became hostile to you for being a smartass and breaking his server). I tend to treat all sysadmins as friends/teammates, there is plenty of other people to fight with: users, management etc :-)

share|improve this answer

There are similar post here

share|improve this answer

You can also run nmap -A to let it guess the OS and version installed on a remote host

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.