General
cancel
Showing results for 
Search instead for 
Did you mean: 

Determining the distribution of the Linux operating system

veena_ts
Occasional Visitor

Determining the distribution of the Linux operating system

Hi all,

I am looking at a way to determine the Linux operating system version on RedHat and SuSE releases.

Is there a RedHat/Novell recommended file which we can lookup to find out the OS version, which is persistent and is not intended to be changed by the users?

I am currently using 'cat /proc/version' to find out if its RHEL or SLES and the contents of /etc/issue.net file to find the actual distribution.

Thanks,
Veena
5 REPLIES
Michal Kapalka (mikap)
Honored Contributor

Re: Determining the distribution of the Linux operating system

Hi,

on redhat :

/etc/redhat-release

for example :

- Red Hat Enterprise Linux AS release 4 (Nahant Update 3)
-Red Hat Enterprise Linux Server release 5 (Tikanga)
-Red Hat Linux Advanced Server release 2.1AS (Pensacola)
-Red Hat Enterprise Linux AS release 4 (Nahant Update 4)

.....

on Suse :

/etc/SuSE-release

for example :

-SUSE Linux Enterprise Desktop 10 (x86_64)
VERSION = 10
-SUSE LINUX Enterprise Server 9 (x86_64)
VERSION = 9
PATCHLEVEL = 3


mikap
avizen9
Esteemed Contributor

Re: Determining the distribution of the Linux operating system

on redhat /etc/redhat-release file
on suse /etc/SuSE-release

you can also find out through uname -a the kernal version
Steven E. Protter
Exalted Contributor

Re: Determining the distribution of the Linux operating system

Shalom,

I would use uname -a

That should give you enough information to determine the release.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mike Stroyan
Honored Contributor

Re: Determining the distribution of the Linux operating system

A standards based solution can be found using the "lsb_release -d" or "lsb_release -i -r" command.
See "man lsb_release" or http://www.unixtutorial.org/commands/lsb_release/ for more information.
Maaz
Valued Contributor

Re: Determining the distribution of the Linux operating system

on SUSE Linux Enterprise you will find 'SPident' and 'SPident -vv'

'SPident -vv' informs you about every details, e.g your current OS Version and Level, and updates that has been installed etc.

Regards
Maaz