#!/bin/bash awk 'BEGIN{print "MEM TOTAL"}NR>1{a+=$5;b+=$6}END{printf "VSZ_SUM:%sM,RSS_SUM:%sM",a/1024,b/1024}' nowcoder.txt