How to show the CentOS Linux version

CentOS Linux FAQ: What commands can I use to show what version of CentOS Linux I'm using?

There are at least two different ways to show what version of CentOS Linux you're using. First, you can use the Linux cat command on the /etc/redhat-release file. Here's the command, and sample output:

# cat /etc/redhat-release

CentOS release 5.6 (Final)

You can also use the lsb_release command with the -a option. Here's that command, and its output:

# lsb_release -a

LSB Version:	:core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID:	CentOS
Description:	CentOS release 5.6 (Final)
Release:	5.6
Codename:	Final

For an old-timer like me, I used to use the Unix uname command to see information like this, but as you can see here, it doesn't really show the CentOS version info:

# uname -a

Linux (ip address was here) 2.6.18-238.19.1.el5PAE #1 SMP Fri Jul 15 08:15:44 EDT 2011 i686 i686 i386 GNU/Linux

I hope this tip on how to show your CentOS version have been helpful.

Add new comment

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.