#!/bin/sh

# Rick van der Zwet
# 0433373
# OS Assigment 2 - Part A
# Licence: BSD
# $Id: partA.sh 508 2008-03-02 14:18:40Z rick $

echo -n "CPU type and model               : "
grep '^model name' /proc/cpuinfo | cut -c 14-

echo -n "Version of Linux kernel          : "
cat /proc/sys/kernel/osrelease

echo -n "Time elapsed since last (re)boot : "
uptime | awk -F, '{print $1}' | cut -c 2-

# http://www.linuxhowtos.org/System/procstat.htm
echo -n "CPU time in user mode            : "
awk '/^cpu / {print $2 + $3}' /proc/stat
echo -n "CPU time in system mode          : "
awk '/^cpu / {print $4}' /proc/stat
echo -n "CPU time in idle mode            : "
awk '/^cpu / {print $5}' /proc/stat

echo -n "Memory configured                : "
awk '/^MemTotal: / {print $2 " " $3 }' /proc/meminfo

echo -n "Memory available                 : "
awk '/^MemFree: / {print $2 " " $3 }' /proc/meminfo
