how to determine kernel version
Ed Gurski
ed at gurski.com
Wed Feb 25 20:14:00 UTC 2004
I've written a script that you can place in /usr/local/bin and execute
each time you want to see what kernel you are using, the uptime and the
kernels installed on your system.
Here it is:
#!/bin/sh
#
# The purpose of this script is to query which kernel
# is currently running on your system...
#
#
# July 25, 2003 by Ed Gurski (ed at gurski.com)
#
KERNEL="`uname -r`" # Get the name of the
current kernel
UPTIME="`uptime`" # Determine how long the
system has been running
RPM="`rpm -qa|grep kernel-2|sort`" # Show all installed
kernels on this system
clear
echo ""
echo $UPTIME|
while read a b c d e f
do
echo "As of $a the system has been up for $c days and $e hours"
done
echo ""
echo "The running kernel is =====> $KERNEL"
echo ""
echo "The Kernels installed on this system are:"
echo "$RPM"
echo ""
============================================================
and a sample output would look like this:
As of 15:13:14 the system has been up for 6 days and 2:45, hours
The running kernel is =====> 2.4.22-1.2174.nptl
The Kernels installed on this system are:
kernel-2.4.22-1.2166.nptl
kernel-2.4.22-1.2174.nptl
Enjoy...
More information about the fedora-list
mailing list