Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have root ssh/terminal access to a linux server. How do I determine which version of centos I have?

Some people suggested I run the command cat /etc/redhat-release but I got an error saying file not found.

In fact, i'm not entirely sure i'm even using CentOS. That's what some suggested it might be.

Here's a list of commands I tried that gave me no file or directory error:

cat /etc/*release*
cat /etc/*version*
cat /proc/*version*
cat /proc/*release*

Here's a list of linux commands that do not exist:

lsb_release: command not found
wget: command not found
yum: command not found
share|improve this question
    
@panaroik - that also gave me a no file in directory –  John Sep 10 '12 at 20:25
    
John sorry, just moved my comment to answer :) –  panaroik Sep 10 '12 at 20:26
    
cat /proc/version? –  quanta Sep 10 '12 at 20:26
1  
What's the output of uname -a? Many distros put their own mark in the kernel version number. RHEL-derived kernel versions tend to have the string "EL" or "el" in them. At least this can help you figure out if you're running RHEL or a derivitive. –  Charles Sep 10 '12 at 20:32

4 Answers 4

up vote 0 down vote accepted

try this one to match all possibilities if there is some similar file by any chance

cat /etc/*release*
cat /etc/*version*
share|improve this answer
    
both says no such file in directory –  John Sep 10 '12 at 20:26
3  
just checking, is your OS linux or unix? uname -a ? –  panaroik Sep 10 '12 at 20:27
1  
AH! got it. uname -a says this is Darwin. Ok so it's not cent os at all! –  John Sep 10 '12 at 20:31
2  
@John more generally, it's not even linux. –  cjc Sep 10 '12 at 20:34

How about this:

cat /etc/issue
share|improve this answer
    
It says no such file in directory –  John Sep 10 '12 at 20:20
2  
lsb_release -a? –  quanta Sep 10 '12 at 20:27
    
lsb_release command not found –  John Sep 10 '12 at 20:29

Try

# rpm -qa | grep release
centos-release-5-8.el5.centos
centos-release-notes-5.8-0

...although the fact that you don't have /etc/redhat-release implies you either don't have a redhat variant, or that the installed instance has been seriously modified.

share|improve this answer

If it's Darwin, does sw_vers give you anything useful?

Something like:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.8.1
BuildVersion:   12B19
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.