Friday, March 8, 2013

How to get Linux version information

There are various ways we can get Linux version information  and commands below are commonly used in various Linux distribution.

1. by simply viewing file /proc/version using cat.


[root@localhost /]# cat /proc/version
Linux version 2.6.18-164.el5 (mockbuild@x86-002.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Tue Aug 18 15:51:54 EDT 2009


2. by using "uname" command.

[root@localhost /]# uname -a
Linux localhost.localdomain 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linux

3. by using "lsb_release" commands.

[root@localhost /]# lsb_release -a
LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Release:        5.4
Codename:       Tikanga

4. by using "dmesg" command (display kernal message buffer) .

[root@localhost /]# dmesg |grep "Linux version"
Linux version 2.6.18-164.el5 (mockbuild@x86-002.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Tue Aug 18 15:51:54 EDT 2009

this command is very useful to get various configuration information from Linux system.

No comments:

Post a Comment