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?
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:
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
uname -ato 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.
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!
I do have a comment, now that you mention it!
Check This Out Too...
Look for Answers
All Our Categories
Apple iPad Help
Articles and Reviews
Auctions and Online Shopping
Blogs and Blogging
Building Web Site Traffic
Business and Management
Computer and Internet Basics
d) None of the Above
Google Gmail Help
Google Plus Help
Industry News and Trade Shows
iPhone and Cell Phone Help
iPod, Sony PSP and MP3 Player Help
Kindle Fire Help
Mac OS X Help
Pay Per Click (PPC) Advertising
Search Engine Optimization (SEO)
Shell Script Programming
Tech Support Video Help
The Writing Business
Twitter, LinkedIn and Social Network Help
Unix and Linux Help
Video Game Tips and Help
Windows PC Help
Find Me on Google+
ADT on G+