Found a nice lil trick
This commit is contained in:
parent
8ba9b20152
commit
167260211a
1 changed files with 1 additions and 1 deletions
|
@ -19,7 +19,7 @@ get_percent()
|
|||
Darwin)
|
||||
# percent=$(ps -A -o %mem | awk '{mem += $1} END {print mem}')
|
||||
used_mem=$(top -l 1 -s 0 | grep PhysMem | awk '{mem += $2} END {print mem}')
|
||||
total_mem=$(system_profiler SPHardwareDataType | grep "Memory:" | awk '{mem += $2} END {print mem}')
|
||||
total_mem=$(system_profiler SPHardwareDataType | grep "Memory:" | awk '{print $2 $3}' | sed 's/used//g')
|
||||
echo $used_mem/$total_mem\G\B
|
||||
;;
|
||||
|
||||
|
|
Loading…
Reference in a new issue