Also try
cat /etc/*release*
Main Topics
Browse All TopicsHow do I check what is the Linux version installed on my machine? and how do I check for the system uptime
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
elease Information File
Most of the Linux distributions maintain release information file in an/etc/directory. Here is the list of files on some of the well known Linux distributions:
Novell SUSE /etc/SuSE-release
Red Hat /etc/redhat-release, /etc/redhat_version
Fedora /etc/fedora-release
Slackware /etc/slackware-release, /etc/slackware-version
Debian /etc/debian_release, /etc/debian_version,
Mandrake /etc/mandrake-release
Yellow dog /etc/yellowdog-release
Sun JDS /etc/sun-release
Solaris/Sparc /etc/release
Gentoo /etc/gentoo-release
UnitedLinux /etc/UnitedLinux-release
ubuntu /etc/lsb-release
Using system command uname and contents of the release files you can write scripts of programs to help to detect distribution.
#!/bin/sh
# Detects which OS and if it is Linux then it will detect which Linux Distribution.
OS=`uname -s`
REV=`uname -r`
MACH=`uname -m`
GetVersionFromFile()
{
VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // `
}
if [ "${OS}" = "SunOS" ] ; then
OS=Solaris
ARCH=`uname -p`
OSSTR="${OS} ${REV}(${ARCH} `uname -v`)"
elif [ "${OS}" = "AIX" ] ; then
OSSTR="${OS} `oslevel` (`oslevel -r`)"
elif [ "${OS}" = "Linux" ] ; then
KERNEL=`uname -r`
if [ -f /etc/redhat-release ] ; then
DIST='RedHat'
PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/SuSE-release ] ; then
DIST=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//`
REV=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //`
elif [ -f /etc/mandrake-release ] ; then
DIST='Mandrake'
PSUEDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/debian_version ] ; then
DIST="Debian `cat /etc/debian_version`"
REV=""
fi
if [ -f /etc/UnitedLinux-release ] ; then
DIST="${DIST}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]"
fi
OSSTR="${OS} ${DIST} ${REV}(${PSUEDONAME} ${KERNEL} ${MACH})"
fi
echo ${OSSTR}
Using system command uname and contents of the release files you can write your own program to detect the OS or which Linux distribution is installed. You can refer
http://cvs.gnome.org/viewc
See http://www.novell.com/docu
for all documentation regarding SUSE Enterprise Server 10.
For the uptime, try the commands "uptime" (without the quotation marks). The command "top" (without the quotation marks) will also give you your uptime on the top line of its output.
When people say "version" of Linux, they usually mean "distribution". A version of Linux applies to the kernel. The latest version is about 2.6.21. A distribution is, for example, Fedora, SuSE or Ubuntu.
The command "uname -a" (without the quotation marks) should give you your version. The following (long) command, will, hopefully, give you information about your distribution:
for this in /etc/SuSE-release /etc/redhat-release /etc/redhat_version /etc/fedora-release /etc/slackware-release /etc/slackware-version /etc/debian_release /etc/debian_version /etc/mandrake-release /etc/yellowdog-release /etc/sun-release /etc/release /etc/gentoo-release /etc/issue /etc/issue.logo ; do cat $this 2> /dev/null ; done
Business Accounts
Answer for Membership
by: BibliophagePosted on 2007-07-05 at 09:14:42ID: 19425208
The actual 'version' is greatly variable, depending on whether you want to know the kernel version, the distribution itself, or release.
From a command prompt, the command 'uname -a' should give you the kernel version. Putting that string into Google will generally cross-reference it into a particular distribution release version.
To check the uptime, most Linux systems will accept 'uptime' as a command line option. It'll generally show you everything in days.