Q. How do I find out what kernel version I am currently running under Debian Linux or any other Linux distribution using a shell prompt?
A. Use uname command which print certain system information such as:
=> Kernel version and name
=> Print the machine hardware name
=> print the processor type
=> print the operating system etc
This command works under all Linux distroubtions and other UNIX like operating systems such as FreeBSD, OpenBSD, Solaris, HP UX etc. Type the following command to see running kernel version:
$ uname -r
Output:
2.6.22-14-generic
Where,
- 2 : Kernel version
- 6 : The major revision of the kernel
- 22 : The minor revision of the kernel
- 14 : Immediate fixing / bug fixing for critical error
- generic : Distribution specific sting. For example, Redhat appends string such as EL5 to indicate RHEL 5 kernel.
Another common usage:
$ uname -mrsn
Output:
Linux moon.nixcraft.in 2.6.18-53.1.4.el5 x86_64
/proc/version file
You can also obtain kernel version from /proc/version file:
$ less /proc/version
$ more /proc/version
$ cat /proc/version
Output:
Linux version 2.6.18-53.1.4.el5 (brewbuilder@hs20-bc2-3.build.redhat.com) (gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)) #1 SMP Wed Nov 14 10:37:27 EST 2007
Package management tools
You can list all installed kernel and its version with the following command under RHEL / CentOS / Suse / Fedora Linux :
$ rpm -q kernel
Output:
kernel-2.6.18-53.el5 kernel-2.6.18-53.1.4.el5
If you are using Debian / Ubuntu, try:
$ dpkg --list | grep linux-image
Output:
ii linux-image 2.6.22.14.21 Generic Linux kernel image. rc linux-image-2.6.20-15-generic 2.6.20-15.27 Linux kernel image for version 2.6.20 on x86/ ii linux-image-2.6.20-16-generic 2.6.20-16.32 Linux kernel image for version 2.6.20 on x86/ ii linux-image-2.6.22-14-generic 2.6.22-14.47 Linux kernel image for version 2.6.22 on x86/ ii linux-image-generic 2.6.22.14.21 Generic Linux kernel image
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 26 comments… read them below or add one }
In Solaris uname -r will give you the solaris release level.
some other usefull options with uname are
uname -s [Operating system]
SunOS
uname -r [Release version]
5.8
uname -v
Generic_117350-27[OS version]
uname -a
SunOS hostname 5.8 Generic_117350-27 sun4u sparc
the last two words describes h/w name and processor respctl[equivalent to -m and -p),
I log on to different RedHat based servers, Can you please update on how to differentiate between Centos, RedHat, Oracle Linux (i.e. RedHat based distributions) sitting remotely.
# uname -a (doesn’t help)
# cat /etc/redhat-relaese (its changed to RedHat as some softwares don’t get installed otherwise.
Thanks
Mohit
Quite useful for beginners and mediocre persons.
i need linux fonts
Thnksssss
cat /etc/redhat-release
this will give you redh hat version or centos version
$ cat /etc/redhat-release
this command return the Centos version
Thanks!
Newbie here….kind of got thrown in Linux admin for Centos at work due to staff reduction. Confused about something (well lots of things, but can’t seem to find the answer to this particular question).
[root@xxx ~]# rpm -qa kernel
kernel-2.6.9-89.0.15.EL
kernel-2.6.9-89.0.19.EL
kernel-2.6.9-89.0.28.EL
kernel-2.6.9-89.0.29.EL
kernel-2.6.9-78.0.22.EL
kernel-2.6.9-89.0.11.EL
kernel-2.6.9-89.0.16.EL
kernel-2.6.9-89.0.23.EL
kernel-2.6.9-89.0.25.EL
kernel-2.6.9-89.29.1.EL
kernel-2.6.9-78.0.5.EL
kernel-2.6.9-78.0.8.EL
kernel-2.6.9-78.0.13.EL
kernel-2.6.9-89.0.18.EL
[root@xxx ~]# uname -a
Linux xxx 2.6.9-78.0.22.EL #1 Thu Apr 30 19:03:25 EDT 2009 i686 athlon i386 GNU/Linux
Why does rpm -qa show kernel-2.6.9-89.0.xxxxx installed but uname -a shows 2.6.9-78.00.22.EL?
I know this probably really stupid question – sorry :(
TIA.
Send me all shell and kernel cammond of linux or unix
Life is so easy huh? :)
Send me all the words in the english language and their uses ( I dont claim that this line is original ;) )
hahaha…lol…AMukh…ur reply is perfect….life is not that easy
THANKYOU!
Thank you very much all friend
Utility uname don’t have any info about OS version, only OS platform!!! uname -p gives
GNU/Linux… No info there are in environment variables. But I need the info like that
openSUSE 12.1 (x86_64)… How to solve this problem? I don’t want to set some environment variable manually…
can you install linux on a computer that has another operating system already installed
Yes, this is possible.
use any VM to install multiple os on same machine
I have installed “Linux mint” I want to know the complete info of my Linux version installed like Linux version kernel version
Thanks
Thank U Very Much senior and all
how to get the OS manufacturer,OS version,OS serial number and number of registered users on linux machine
sudo cat /etc/passwd | grep /bin/bash
UID’s 1000 and above are valid users plus UID 0 for root
dpkg –list | grep linux-image
ii linux-image-2.6.38-11-generic 2.6.38-11.50 Linux kernel image for version 2.6.38 on x86/x86_64
rc linux-image-2.6.38-8-generic 2.6.38-8.42 Linux kernel image for version 2.6.38 on x86/x86_64
ii linux-image-3.0.0-12-generic 3.0.0-12.20 Linux kernel image for version 3.0.0 on x86/x86_64
ii linux-image-3.0.0-16-generic 3.0.0-16.29 Linux kernel image for version 3.0.0 on x86/x86_64
ii linux-image-3.0.0-17-generic 3.0.0-17.30 Linux kernel image for version 3.0.0 on x86/x86_64
ii linux-image-generic 3.0.0.17.20 Generic Linux kernel image
what does it mean 32 or 64 bit ?
when give uname -a o/p is
Linux xxxxx 3.0.0-17-generic #30-Ubuntu SMP Thu Mar 2 17:34:21 UTC 2012 i686 i686 i386 GNU/Linux
when i do file on some executable it tells it 32 bit.
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
thanks a lot.
Hi
I need Kernel type and can u explain?
Thanks for publishing useful contents like this……..