Industry guru Dave Taylor offers tech support on technical and business topics, including iPhone, iPod, Microsoft Windows, Sony PSP, cellphones, online advertising, CSS, Web design, business, Unix, Linux, SEO, Mac OS X, and shell script programming.     


What version of Linux am I running?

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?


Dave's Answer:

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 like this:

ssh initial screen

But, you can find out what version of Linux your server is running, by executing this command:

cat /etc/*release*

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:

cat release output

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

uname -a
to obtain output like the following:

uname output

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.


More Useful Unix and Linux Help Articles:
✔   Copy and Paste from the Mac OS X Command Line?
I am constantly running commands in Terminal.app on my MacBook and then copying and pasting the results into email messages or documents. Yes,...
✔   Shell script to convert lowercase to title case?
As part of a project I'm working on, I find myself deep in a Linux shell script, needing to have a subroutine that...
✔   Can I script renaming files based on an XML data map?
I have a folder full of files which are named with four digits and a file extension e.g. 0312.file and an XML-file describing...
✔   Test for valid numbers in a Bash shell script?
In a different discussion on this site [see Redirecting input in a shell script] a visitor commented that "I was too busy trying...
✔   Review: iSSH for the iPad/iPhone
If you're running an online business like I am, there are times when you need to connect and log in to the server...

Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
    Enter your name: and your email addr:  





Categorized: Unix and Linux Help   (Article 9208, Written by )
Tagged: fedora, linux, operating systems, ssh, suse, ubuntu, unix, vps
Previous: Can I post Facebook updates to just my friends?
Next: How do I find my Microsoft Windows product key?




Reader Comments To Date: 2

Shambhu said, on December 11, 2009 4:13 PM:

Wow, I've been reading this site for a few days and only just noticed that it's supposed to be a whiteboard!

The site's great but I always thought it was supposed to look like a (big) white page. Then I noticed the edges were quite thick, and, scrolling down, came to these strange shapes on the bottom. I couldn't make head or tail of them. The black thing looked like some sideways tire or button and then suddenly the whole thing snapped into focus as I realized the other things were dry-erase markers.

I guess everyone who's asked Dave a question figured it out long ago.

Dave Taylor said, on December 11, 2009 9:49 PM:

Shambhu, thanks! When we were designing it I was tempted to pay my developer to write some code so you could pick up the markers and scribble on the page, but decided no-one would ever notice or try it. :-)

Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you, Dave, for all your helpful information by buying you a cup of coffee!

I do have a comment, now that you mention it!











I will never send you any unsolicited email. Ever.






Check This Out Too...

 
Look for Answers
Need Help? Ask Dave Taylor!
Powered By
Linux Journal: Free Issue!


Follow Me on Pinterest

Find Me on Google+
ADT on G+
© 2002 - 2013 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site. Further, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site. My lawyer says "Thanks".
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.