-bash-3.1$ pmap -x 2401|grep 'total'>tmpfile ##查看进程2401占用的内存大小,且写入到tmpfile文件中
-bash-3.1$ cat tmpfile |awk '{sum+=$3;} END {print sum}' ##查看tmpfile文件第三列累计值
-bash-3.1$ more tmpfile
total kB 4280 - - -
total kB 4280 - - -
-bash-3.1$ cat tmpfile |awk '{sum+=$3;} END {print sum}' ##为第三列累计值,所以是8560
8560