How to use the free command in Linux


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.

free --help
version information
free --version
free -V
free from procps-ng 3.3.10

The free command can be executed without any option. This shows the memory and swap usage about the system.

Human Readable
free -h
in megabytes
free --mega
free -h -t
   total used free shared buff/cache available
Mem: 1015024 197720 92424 256 724880 614944
Swap: 4194300 186112 4008188

Display Memory Usage Information Continuously

seconds | CTRL+C
free -s 4
free -s 5 -c 10

The syntax for the free command is as follows:

  free [options]

-b, --bytes
show output in bytes
-k, --kilo
show output in kilobytes
-m, --mega
show output in megabytes
-g, --giga
show output in gigabytes
show output in terabytes
show output in petabytes
-h, --human
show human-readable output
use powers of 1000 not 1024
-l, --lohi
show detailed low and high memory statistics
-t, --total
show total for RAM + swap
-s N, --seconds N
repeat printing every N seconds
-c N, --count N
repeat printing N times, then exit
-w, --wide
wide output
display this help and exit
-V, --version
output version information and exit

Related Tags

#Linux# #free#