linux系统 awk命令统计每一个用户进程占用的内存

linux系统awk命令统计每一个用户进程占用的内存。

1、

[root@centos7 test2]# ps aux | awk 'NR != 1 {a[$1]+=$6} END{for(i in a) print i, a[i]}'
geoclue 3096
rpc 104
rstudio+ 52
colord 256
rtkit 288
dbus 2896
polkitd 1760
nobody 4
libstor+ 60
avahi 452
postfix 4244
root 535952
原文地址:https://www.cnblogs.com/liujiaxin2018/p/14742303.html