How to check CentOS version via command line?

by Stephen on October 22, 2009 · 13 comments

in CentOS

Via command line, type this:

cat /etc/redhat-release

To safely upgrade CentOS to the latest version, type this:

yum update

{ 13 comments… read them below or add one }

amit joshi January 5, 2012 at 3:02 am

helpful

Reply

S February 6, 2012 at 9:42 am

I disagree. the cat /etc/redhat-release does nothing on Centos.

Reply

Anon February 7, 2012 at 10:16 pm

It works just fine.

Reply

doesn't work on centos April 5, 2012 at 3:40 pm

No it doesn’t. /etc/redhat-release doesn’t exist on centos.

Reply

Stephen April 5, 2012 at 4:02 pm

Works just fine for me:

root@host [~]# cat /etc/redhat-release 
CentOS release 5.8 (Final)

Reply

Chris March 21, 2012 at 6:06 pm

Pefect!

Reply

Ron March 21, 2012 at 11:12 pm

works great thanks

Reply

Sunil Hankare June 9, 2012 at 4:13 am

cat /etc/*release*

Reply

Sunil Hankare June 9, 2012 at 4:15 am

lsb_release -a

Reply

Jeet October 25, 2012 at 5:00 am

Its not relevant to CentOS, that is for Ubuntu ;)

Reply

Matli Digital December 7, 2012 at 1:32 am

Hi,

Thank you, its working fine on CentOS 5.6 (Final). its showing me exactly version. as well I started the Updates process with the “yum update” commands.

Thanks

Reply

Si December 19, 2012 at 9:40 am

Thanks alot, it works fine for me.

Reply

Marwan April 14, 2013 at 10:26 pm

Works. Thank You.

Reply

Leave a Comment

Previous post:

Next post: