I have a Virtual Private Server or a dedicated server running Linux, but
I’m not sure which version of Linux (Fedora, CentOS, Debian, etc.) the server
is running. How do I find out?
Your hosting provider, of course, should have told you what version of Linux you were using
when they first set up the dedicated server or the Virtual Private Server for you. But if
you don’t remember, it’s surprisingly non-intuitive to try and figure out which version of
Linux your machine is running.
Unlike Windows or other operating systems that display the name of the operating
system when you first sign on to the computer (Windows XP Home, Windows XP Pro, Windows
Vista, Windows 7, etc.), a remote connection to a Linux machine
won’t automatically tell you what type of Linux you are using.
For the purposes of this article I’m assuming that you’re connected to your Virtual Private
Server or your dedicated server via a shell connection, one that lets you type commands
and view the output. (This would normally be a telnet connection, or, more safely,
a “secure shell” or SSH connection.)
When you initially use SSH to open a connection to your server, you might see a greeting
But, you can find out what version of Linux your server is running, by executing this command:
In Linuxese, this means, “Show me the contents of all files in the “/etc/” directory that
have the string “release” somewhere in their names.” If you type that command, you should
get output something like this:
You can ignore any message like “cat: /etc/lsb-release.d: Is a directory” — this just means
that the command found an item in the “/etc/” directory that had “release” in its name —
“lsb-release.d” — but it’s a directory, so “cat” cannot show you the contents. Instead,
“cat” displayed to me the contents of a file that happened to be named redhat-release, and
that file shows that this machine is running “CentOS release 5.4 (Final)”.
On machines running other distributions of Linux
(also called other “distros”, or sometimes “flavors”), you will get something different. On Suse
Linux, the output will be something like:
SUSE LINUX 10.0 (X86-64) OSS VERSION = 10.0
On Fedora Linux the output might say:
Fedora release 8 (Werewolf)
On Ubuntu it might look like:
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=7.10 DISTRIB_CODENAME=gutsy DISTRIB_DESCRIPTION="Ubuntu 7.10"
In addition, you can run the command
to obtain output like the following:
Of these pieces of information, “2.6.18-028stab062.12″ refers to the kernel version
(the kernel refers to what could be considered the “heart” of the operating system, the
software at the core of Linux without which it could not run at all). “SMP”
stands for “symmetric multi-processing” and indicates that the machine includes two
or more processors to help run programs faster. (Although keep in mind that on a Virtual
Private Server, you’re sharing those CPUs with other users.) “Thu Jun 25 20:03:10 MSD 2009″
is the current date, and “i686 athlon i386″ refers to the type of CPU (not the specific
processor on your machine, but the CPU “architecture” or category of CPU that this type of
Linux was built to run on).
If someone troubleshooting a problem for you asks you for “what type of Linux” you’re running,
most likely they are referring to the distro, which you can determine with “cat /etc/*release”.
But it can’t hurt to include the output of “uname -a” as well.
Bennett Haselton is a technology and political blogger who can answer other questions
besides this one, like how to bypass/disable
the St. Bernard Internet filter.