Need Help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need Help
# 1  
Old 10-05-2012
Question Need Help

Hi,

I am new to scripting need help, my requirement is to add the % of memory and cpu of top command.

so that script will display total Memory utilization and CPU Utilization in % of top command.

even it does not display which proess is utilizing most memory.
# 2  
Old 10-05-2012
try:
Code:
top -abc -n 3 | awk 'r>=3{c+=$9;m+=$10}$(NF)~/^COMMAND$/{r++}END{print "CPU: ",c,"MEM: ",m;}'

Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question