[Linux] ps+awk +while View process memory usage in real time

Sometimes you need to see how much memory the process occupies

You can use my shell, you can view each process you want to see and the total memory

The red part is my process, here you can come according to your needs

while true;do clear;date;ps aux|grep go-fly-pro |grep -v grep|awk’BEGAIN{sum=0}{sum+=$6;print $6/1014 “M” “\t” $0;} END{print “sum:” sum/1024 “M”}’;sleep 1;done

 

This sentence is to check the process memory of my online customer service, which accounts for a total of 45M, and the main work child process accounts for 29M

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *