Get the App
SLTechnology News&Howtos  ›  Network Security  › 

The sum of the amount of memory consumed by the process

Shulou Source: shulou.com Published: 2022-06-01 04:45:15 10月05日 Update

# / bin/bash!

Sum=0

For mem in `ps aux | awk'{print $6}'| grep-v 'RSS' `

Do

Sum=$ [$sum+$mem]

Done

Echo "The total memory is $sum"k"

Tags: Memory size process Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Huawei Redmi Docker Linux