#!/usr/bin/bash top -bn1 | grep "Cpu(s)" | awk '{print $2}' #cat /proc/stat | grep '^cpu ' | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage}'