2

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
4
  • @panaroik - that also gave me a no file in directory Sep 10, 2012 at 20:25
  • John sorry, just moved my comment to answer :)
    – panaroik
    Sep 10, 2012 at 20:26
  • cat /proc/version?
    – quanta
    Sep 10, 2012 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, 2012 at 20:32

4 Answers 4

0

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

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

How about this:

cat /etc/issue
3
  • It says no such file in directory Sep 10, 2012 at 20:20
  • 2
    lsb_release -a?
    – quanta
    Sep 10, 2012 at 20:27
  • lsb_release command not found Sep 10, 2012 at 20:29
1

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.

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .