determine CPU and memory top users

So your system is acting screwy and you are tying to figure out what is going wrong.  List the processes in order to determine who the CPU or memory hogs are.

List how much CPU percent and time each process is using

$ps -e -o pcpu,cpu,nice,state,cputime,args –sort pcpu | sed ‘/^ 0.0 /d’

In order to list the process with how much memory each process is using, listed from lease to most memory hogs.

$ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS