Advertisement
Guest User

memUsage.sh

a guest
Nov 23rd, 2011
1,481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.32 KB | None | 0 0
  1. #!/bin/bash
  2. while [ 1 ]
  3. do
  4.   total=`cat /proc/meminfo | grep MemTotal | cut -d ":" -f 2 | cut -d "k" -f 1 | tr -d " "`
  5.   free=`cat /proc/meminfo | grep MemFree | cut -d ":" -f 2 | cut -d "k" -f 1 | tr -d " "`
  6.   currentTime=`date +%s`
  7.   echo -n $currentTime
  8.   echo -n " "
  9.   echo "$total - $free" | bc
  10.   sleep 1
  11. done
  12.  
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement