使用ps
命令,我可以找出每个程序使用了多少内存:
ps -u mertnuhoglu -o pcpu,rss,pid,command
是否可以轻松地找出每种类型的资源使用量的总和?
您可以将使用情况列汇总为awk
:
ps --no-headers -u $USER -o pcpu,rss | awk '{cpu += $1; rss += $2} END {print cpu, rss}'
您可能还free
对内存使用命令感兴趣:
$ free
total used free shared buffers cached
Mem: 2055480 1806596 248884 0 14016 346276
-/+ buffers/cache: 1446304 609176
Swap: 2097148 132980 1964168
输出以千free --mega
字节free -m
为单位(用于兆字节或兆字节)。特别是used
,+/- buffers/cache
条目类似于总使用的物理内存(每个人)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句