Understand, Learn and Implement.. LINUX / UNIX DEVOPS CONTAINERS OPENSHIFT KUBERNETES DEVOPS TOOLS VIRTUALIZATION STORAGE BACKUP SCRIPTS MONITORING MIDDLEWARE

Thursday, August 21, 2014

Print the processes cpu usage and memory

To list the processes ordered by CPU and memory usage in Linux. 

My resolution was this:

ps -eo pcpu,pid,user,args,pmem | sort -k 1 -r | head -10

And if you want to have a terminal listing it you can use this line:

for i in `seq 1 10`; do ps -eo pcpu,pid,user,args,pmem | sort -k 1 -r | head -10; sleep 1; clear; done


0 comments:

Post a Comment