shell scipt to find Linux top process usage

#!/bin/bash
#High RAM usage checker
r=`free -m |awk 'NR==2' |awk '{ print$4 }'`
if [ $r -lt 700 ];
then
ps -e -orss=,args= | sort -b -k1,1n |tail -n 20 >> overusage
exit
fi

from helpinlinux.com

Advertisements