What is equivalent of Linux's 'free' command on FreeBSD v8.1

WilliamKF picture WilliamKF · Nov 4, 2010 · Viewed 50.6k times · Source

What is equivalent of Linux's 'free' command on FreeBSD v8.1?

I am calling 'free' from my application and reporting the results in my application's log file. What would be the replacement when porting to FreeBSD v8.1?

Here is a sample run of 'free' on Linux:

[centos4x32 ~] free
             total       used       free     shared    buffers     cached
Mem:        774452     733044      41408          0      98040     328880
-/+ buffers/cache:     306124     468328
Swap:      2031608        224    2031384

Answer

Ben Jackson picture Ben Jackson · Nov 4, 2010
  • vmstat has default output which is similar in nature and takes many options that give extremely detailed information, eg vmstat -m
  • swapinfo would cover the swap part
  • top -d1 causes top to print one screen and exit, and the banner is very similar to free. Use top -d1 | head -n 7 to see only the banner