Re: how to determine kernel version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx)
#
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...




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux