Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 676
WilliamKF Avatar asked Nov 04 '10 03:11

WilliamKF


People also ask

What is the default shell for FreeBSD?

The default command line shell for FreeBSD is tcsh , but some virtual private servers running FreeBSD use another shell (such as sh ) by default. If you'd like to set tcsh as your freebsd user's default shell, run the following command: sudo chsh -s /bin/tcsh freebsd.

What is available in free command in Linux?

The Linux free command outputs a summary of RAM usage, including total, used, free, shared, and available memory and swap space. The command helps monitor resource usage and allows an admin to determine if there's enough room for running new programs. In this tutorial, you will learn to use the free command in Linux.

What is free RAM in Linux?

available memory in Linux is, that free memory is not in use and sits there doing nothing. While available memory is used memory that includes but is not limited to caches and buffers, that can be freed without the performance penalty of using swap space.


3 Answers

  • 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
like image 71
Ben Jackson Avatar answered Oct 07 '22 19:10

Ben Jackson


Maybe freecolor command is a choice. Install it:

# cd /usr/ports/sysutils/freecolor
# make install clean

Use it:

# freecolor
Physical  : [#################################..] 94%   (1907820/2018396)
Swap      : [###################################] 100%  (1048540/1048540)
# freecolor -m -o
             total       used       free     shared    buffers     cached
Mem:          1971        107       1863          0          0          0
Swap:         1023          0       1023

Please refer FreeBSD find out RAM size Including Total Amount of Free and Used Memory Size.

like image 23
Nan Xiao Avatar answered Oct 07 '22 19:10

Nan Xiao


vmstat -s gives some more human-readable or script-parseable information, including listing the page size. Otherwise, it gives output in numbef of pages. With no options, vmstat gives a brief summary.

The vmstat command also exists on NetBSD.

like image 29
Brian Minton Avatar answered Oct 07 '22 21:10

Brian Minton