Linux "free" Command Line Options and Examples
allocate and free dynamic memory

free displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel. The information is gathered by parsing /proc/meminfo.


Usage:

free [options]






Command Line Options:

-b
Display the amount of memory in bytes.
free -b ...
-k
Display the amount of memory in kibibytes. This is the default.
free -k ...
-m
Display the amount of memory in mebibytes.
free -m ...
-g
Display the amount of memory in gibibytes.
free -g ...
--tebi
Display the amount of memory in tebibytes.
free --tebi ...
--pebi
Display the amount of memory in pebibytes.
free --pebi ...
--kilo
Display the amount of memory in kilobytes. Implies --si.
free --kilo ...
--mega
Display the amount of memory in megabytes. Implies --si.
free --mega ...
--giga
Display the amount of memory in gigabytes. Implies --si.
free --giga ...
--tera
Display the amount of memory in terabytes. Implies --si.
free --tera ...
--peta
Display the amount of memory in petabytes. Implies --si.
free --peta ...
-h
Show all output fields automatically scaled to shortest three digit unit and display the units of print out. Following unitsare used.B = bytesK = kibibyteM = mebibyteG = gibibyteT = tebibyteP = pebibyteIf unit is missing, and you have exbibyte of RAM or swap, the number is in tebibytes and columns might not be aligned withheader.
free -h ...
-w
Switch to the wide mode. The wide mode produces lines longer than 80 characters. In this mode buffers and cache are reportedin two separate columns.
free -w ...
-c
Display the result count times. Requires the -s option.
free -c ...
-l
Show detailed low and high memory statistics.
free -l ...
-s
Continuously display the result delay seconds apart. You may actually specify any floating point number for delay usingeither . or , for decimal point. usleep(3) is used for microsecond resolution delay times.
free -s ...
--si
mega giga etc (power of 1000) instead of kibi mebi gibi (power of 1024).
free --si ...
-t
Display a line showing the column totals.
free -t ...
-V
Display version information.FILES/proc/meminfomemory informationBUGSThe value for the shared column is not available from kernels before 2.6.32 and is displayed as zero.Please send bug reports to⟨procps@freelists.org⟩
free -V ...