You need to use the following two commands:
Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | No |
Requirements | None |
Time | 1m |
How to check linux kernel version number?
Open a shell prompt (or a terminal) and type the following command to see your current Linux kernel version:
$ uname -r
Sample outputs:
2.6.32-23-generic-pae
Or type the following command:
$ uname -mrs
Sample outputs:
Linux 2.6.32-23-generic-pae i686
To print all information, enter:
$ uname -a
Sample outputs:
Linux vivek-laptop 2.6.32-23-generic-pae #37-Ubuntu SMP Fri Jun 11 09:26:55 UTC 2010 i686 GNU/Linux
Where,
- 2.6.32-23 – Linux kernel version number
- pae – pae kernel type indicate that I’m accssing more than 4GB ram using 32 bit kernel.
- SMP – Kernel that supports multi core and multiple cpus.
/proc/version file
Type the following command to see Linux version info:
$ cat /proc/version
Sample outputs:
Linux version 3.2.0-0.bpo.1-amd64 (Debian 3.2.4-1~bpo60+1) (ben@decadent.org.uk) (gcc version 4.4.5 (Debian 4.4.5-8) ) #1 SMP Sat Feb 11 08:41:32 UTC 2012
The above output identifies the kernel version that is currently running. It includes the contents of /proc/sys/kernel/ostype, /proc/sys/kernel/osrelease, and /proc/sys/kernel/version files. For example:
$ cat /proc/sys/kernel/{ostype,osrelease,version}
Sample outputs:
Linux 3.2.0-0.bpo.1-amd64 #1 SMP Sat Feb 11 08:41:32 UTC 2012
Find Distribution Version
Type the following command:
$ cat /etc/*release
OR
$ lsb_release -a
Sample outputs:
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 10.04 LTS Release: 10.04 Codename: lucid
Here is another output from my Debian based server:
lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 6.0.6 (squeeze) Release: 6.0.6 Codename: squeeze
Related media
This tutorial is also available in a quick video format:
Video 01: Find The Linux Kernel Version Command Tutorial
- How To Find Out FreeBSD Version and Patch Level Number
- How To Find Which Linux Kernel Version Is Installed On My System
- Find Linux / UNIX Kernel Version Command
- How To Find Out If 32 or 64 bit Unix OS Installed On Server
- Linux: Find If Processor (CPU) is 64 bit / 32 bit [long mode ~ lm]
- List or Check Installed Linux Kernels
- Find Linux Kernel Version Command
- Linux Command: Show Linux Version
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 19 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
COluld you please help what explaination it gives regarding version of linux?.
Linux pd13027a.symphonyteleca.com 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
also a simple command that will show the release of the Linux you have:
$ cat /etc/issue
output: Red Hat Enterprise Linux Server release x.x
How can you be a lonelyDBA when you can provide the perfect answer?
While we’re at it, what should I do with my life? I know, lazy… ;-)
Hi,
how to find OS name with service pack in suse linux.. can you please give the command..
Regards
R.Muthukumar
Not sure what you’re asking here exactly. To get a list of the packages installed you can use the rpm command. rpm -qa to query all packages installed (see man pages on command structure).
For check OS name simply enter “uname” command & for check packages installed or not we can check with the help of “rpm -qa packagename”.
You can get that one from following commands.
To determine it is SuSE:
cat /proc/version
To check SuSE version:
cat /etc/SuSE-release
SUSE LINUX Enterprise Server 9 (i586)
VERSION = 9
thank you guys for this useful information.
Thanks very much !!!!
how to find linux redhat version
for e.p.– redhat 4.4 , redhat 5.4, redhat 5.9
cat /etc/*release
grep -Eo ‘^[^ ]+’ /etc/issue.net | sed ‘2d’
If we want to search the contents of all of the files in current directory and display the total number of lines in them that contain the string Linux. Which of the below commands will do that
cat * | grep Linux | wc -l
cat * | wc -l
grep Linux | wc -l
cat * | head | grep Linux
cat * | grep Linux | wc -l will work .
grep Linux * | wc -l , will also.
Cheers,
K.
how to see the version of linux like for ex: redhat 4.4 , redhat 5.4, redhat 5.9
you know if we make some modifications in /etc/redhat-release v can’t find the correct version like i made some modification redhat enterprises 6.4 to 7.4 all commands are showing this 7.4 version only but not showing original version of that o.s is there any command to see the linux original version please resply for this anybody thank you.
by the way in this site u r giving correct information(commands) and easy procedure thanks for that keep going like this thank u admin
i have face issue in my xubantu 12.04 64 bit desktop version.
when i give print command via excel system going to hang or may be not responding.
I bought a new laptop.. How to use that code with in my laptop to start the operating system..