Hi guys, Here's another shell script to make ur life easy!
Half of the 'how to' was gathered by me from some place else and the rest is purely mine!!
Quote:
#!/bin/sh
# File info.sh by P.S.
echo "Hello $HOSTNAME!"
men()
{
echo -e "\n*********************************"
echo "0. Bring up the menu"
echo "1. CPU info "
echo "2. partition info "
echo "3. Memory info "
echo "4. Usb info"
echo "5. Graphic hardware"
echo "6. CDROM"
echo "7. Kernel info"
echo "8. Mac Address"
echo "9. EXIT "
echo "*********************************"
echo ""
}
men
while [ 1 ]
do
echo ""
echo -n "Option : ";read option
echo ""
case $option in
0)men;;
1)
echo "**** Host Info ****"
echo -e "\n--- CPU Info ---"
cat /proc/cpuinfo | grep model
cat /proc/cpuinfo | grep MHz
cat /proc/cpuinfo | grep cache;;
2)
echo "****Partitions****"
cat < /proc/partitions
echo "**** more ****"
df;;
3)
echo -e "\n--- Memory Info ---"
cat /proc/meminfo | grep MemTotal;;
4)
echo -e "\n--- USB Hubs ---"
lspci | grep USB;;
5)
echo -e "\n--- Graphics Hardware ---"
lspci | grep VGA;;
6)
echo -e "\n--- CDROM ---"
dmesg | grep CD;;
7)
echo -e "\n-- Kernel Version ---"
cat /proc/version;;
8)
echo -e "\n-- Mac Info -- "
ifconfig -a | grep HWaddr;;
9)echo -e "\033[31m"
echo "Thanx 4 using mah script."
echo "If u need any help contact me at darkmediator@gmail.com"
echo -e "\033[0m"
exit;;
*)echo "Enter Valid options";;
esac
done
|
1. Make sure the commands like lspci,dmesg,ifconfig etc are in path!
2. . Save the above script as "hostinfo.sh"
3.. Run it as "sh hostinfo.sh"
4. Njoy!
NOTE : In the script where there's a smiley with black glasses, its actually "option 8". So please correct it urself. I dunno why it happened here, but the code became a smiley
!
I hope u like it! Njoy the Linux the world !