I am using the top command in Mac OS from this answer to grab memory usage:
$ top -l 1 -s 0 | grep PhysMem
PhysMem: 5490M used (2569M wired), 11G unused.
Can I go from that to possibly printing out "Used / Total"?
Like so:
PhysMem: 5.49G / 16.0G
or just:
5.49G / 16.0G
Side questions:
Would that final top command be suitable to run in a few second interval and the output used for something later? Or is this not the best or most efficient command for grabbing this info and I should use something else?
I am basically trying to replicate what Luke Smith did in his video, but in Mac OS for fun, and so I can try to learn this stuff.