Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.56 KB | None | 0 0
  1. alias cpu='read cpu a b c previdle rest < /proc/stat; prevtotal=$((a+b+c+previdle)); sleep 1; read cpu a b c idle rest < /proc/stat; total=$((a+b+c+idle)); CPU=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal))); echo -n "CPU Usage   : "$CPU"% "; CPU_MHZ=$(lscpu | grep "CPU MHz"| cut -d" " -f19 | cut -d"." -f1); echo "("$CPU_MHZ"MHz)"'
  2. alias disk='df -h | awk '\''$NF=="/"{printf "Disk Usage  : %d/%dGB (%s)\n", $3,$2,$5 }'\'''
  3. alias mem='free -m | awk '\''NR==2{printf "Memory Usage: %s/%sMB (%.f%)\n", $3,$2,$3*100/$2 }'\'''
  4. alias sys='cpu; mem; disk'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement