How to find the version of a Linux kernel

book

Article ID: 180084

calendar_today

Updated On:

Products

Notification Server Agent for Unix/Linux (Altiris)

Issue/Introduction

 

Resolution

Following are five distinct ways to find the kernel version on a linux box: 

 

1. uname -r

2. cat /proc/version

3. rpm -q kernel

4. dmesg | grep -i "linux version"

5. ls /boot (this displays several files with version in the file name)

 

Sample results: 

 

# uname -r

2.6.18-8.el5

 

# cat /proc/version 

Linux version 2.6.18-8.el5 ([email protected]) (gcc version 4.1.1 20070105 (Red Hat 4.1.1-52)) #1 SMP Fri Jan 26 14:15:14 EST 2007

 

# rpm -q kernel

kernel-2.6.18-8.el5

 

# dmesg | grep -i "linux version"

Linux version 2.6.18-8.el5 ([email protected]) (gcc version 4.1.1 20070105 (Red Hat 4.1.1-52)) #1 SMP Fri Jan 26 14:15:14 EST 2007

 

# ls /boot

config-2.6.18-8.el5  
initrd-2.6.18-8.el5.img  
symvers-2.6.18-8.el5.gz  
vmlinuz-2.6.18-8.el5

grub                
lost+found              
System.map-2.6.18-8.el5