Shamelessly snagged from Scott Morris @ suseblog.com
Here is a tool called ’sup’ which tells you some useful information about the linux box into which you are logged. Having so many terminal windows open, and screen sessions going, it’s easy to get lost in the labyrinth of connections and sessions. This tool clears all that up for you really quick.
#!/bin/bash
# ORIGINALLY WRITTEN BY SCOTT MORRIS (http://www.suseblog.com/) on 2008-05-28
# UPDATED AS SUGGESTED BY LONNIE OLSON on 2008-05-30
# COLLECT SOME INFO
SYSINFO=`cat /etc/issue | sort | uniq | awk '/[a-zA-Z]/{printf $1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"\n"}'`
IFS=$'\n'
UPTIME=`uptime`
D_UP=${UPTIME:1}
MYGROUPS=`groups`
DATE=`date`
KERNEL=`uname -a`
#SYSINFO=`head -n 1 /etc/issue`
CPWD=`pwd`
ME=`whoami`
# OUTPUT THE DATA
#printf " user:\t\t"$USER" (uid:"$UID")\n"
printf "< === SYSTEM ===>\n"
echo " Distro info: "$SYSINFO""
printf " Kernel:\t"$KERNEL"\n"
printf " Uptime:\t"$D_UP"\n"
free -mot | awk '
/Mem/{print " Memory:\tTotal: " $2 "Mb\tUsed: " $3 "Mb\tFree: " $4 "Mb"}
/Swap/{print " Swap:\t\tTotal: " $2 "Mb\tUsed: " $3 "Mb\tFree: " $4 "Mb"}'
printf " Architecture:\t"$CPU"\n"
cat /proc/cpuinfo | grep "model name\|processor" | awk '
/processor/{printf " Processor:\t" $3 " : " }
/model\ name/{
i=4
while(i< =NF){
printf $i
if(i
printf " User:\t\t"$ME" (uid:"$UID")\n"
printf " Groups:\t"$MYGROUPS"\n"
printf " Working dir:\t"$CPWD"\n"
printf " Home dir:\t"$HOME"\n"
printf "\n< === NETWORK ===>\n"
printf " Hostname:\t"$HOSTNAME"\n"
ip -o addr | awk '/inet /{print " IP (" $2 "):\t" $4}'
/sbin/route -n | awk '/^0.0.0.0/{ printf " Gateway:\t"$2"\n" }'
cat /etc/resolv.conf | awk '/^nameserver/{ printf " Name Server:\t" $2 "\n"}'
#lspci | grep "Audio device:\|VGA compatible" | awk '
#/Audio device/{printf " Audio:\t"
#i=4
#while(i< =NF){
# printf $i
# if(i
Install & run:
wget http://www.suseblog.com/tools/sup.tar.bz2
tar -jxvf sup.tar.bz2
chmod +x sup
sh sup