Article Content
Article Number | 000027949 | ||||||||||||||||||||||||
Applies To | RSA Product Set: Identity Governance & Lifecycle RSA Version/Condition: All | ||||||||||||||||||||||||
Issue | This knowledge base article shows several different commands that may be used to determine the version of Linux that is running on the system being accessed, and what brand of Linux (i. e., Red Hat or SUSE.) The basic operating system information command is uname, but this command does not tell which release of Linux is being used.
$ uname -a
$ uname -a | ||||||||||||||||||||||||
Resolution | There are several commands and methods that can be used to determine the Linux distribution installed. These include: 1. Login via a terminalAfter a successful login, the banner that displays will show the Operating System information. For example,
login as: oracle Using keyboard-interactive authentication. Password: <enter oracle user password> Last login: Tue Nov 30 11:12:32 2010 from 192.168.8.17 Kickstart-installed SuSE Linux Thu Oct 21 10:07:48 EDT 2018
login as: oracle oracle@vm-support-42's password:<enter oracle user password> Last login: Wed Nov 17 11:50:07 2010 from 192.168.8.19 Kickstart-installed Red Hat Linux Wed Oct 27 10:54:47 EDT 2018 2. Print out the version using the command cat /proc/version or uname -aPlatform version information is kept in the /proc/version file. Review of this file provides operating system information.
$ cat /proc/version Linux version 2.6.27.19-5-default (geeko@buildhost) (gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux) ) #1 SMP 2009-02-28 04:40:21 +0100
$ cat /proc/version Linux version 2.6.32-431.el6.x86_64 ( mockbuild@x86-023.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Sun Nov 10 22:19:54 EST 2013 $ uname -a Linux acm-701rh 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux For reference, these values correspond to these versions of Red Hat:
3. Linux command that can be used to determine the OS: lsb_release -a
$ lsb_release -a LSB Version: n/a Distributor ID: SUSE Description: SUSE Linux Enterprise Server 12 SP2 Release: 12.2 Codename: n/a
$ lsb_release -a LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0 noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0 amd64:printing-4.0-ia32:printing-4.0-noarch Distributor ID: RedHatEnterpriseServer Description: Red Hat Enterprise Linux Server release 5.8 (Tikanga) Release: 5.8 Codename: Tikanga 4. Check for the existence of certain operating system-specific files in the /etc directoryAnother simple way to determine the operating system type is to check for the existence of certain OS-specific files in the /etc directory:
Files beginning with suse will not exist on a Red Hat system and files beginning with red will not exist on a SUSE system.
ls: cannot access /etc/red*: No such file or directory $ cd /etc $ ls -la | grep -i suse -rw-r--r-- 1 root root 17 Oct 25 2016 SUSE-brand -rw-r--r-- 1 root root 377 Jun 14 2017 SUSEConnect.example drwxr-xr-x 3 root root 4096 Feb 15 2018 susehelp.d -rw-r--r-- 1 root root 215 Oct 25 2016 SuSE-release
$ ls /etc/suse* ls: /etc/suse*: No such file or directory $ ls -la | grep -i red drwxr-xr-x. 2 root root 4096 Mar 1 2017 redhat-lsb -rw-r--r--. 1 root root 55 Oct 30 2013 redhat-release l rwxrwxrwx. 1 root root 14 Mar 1 2017 system-release -> redhat-release |