How to use the free command in Linux

Created

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.

memory
free
Help
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.

memory
free
Human Readable
free -h
in megabytes
free --mega
Totals
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
--count
free -s 5 -c 10

The syntax for the free command is as follows:

Usage: 
  free [options]

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
--tera
show output in terabytes
--peta
show output in petabytes
-h, --human
show human-readable output
--si
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
--help
display this help and exit
-V, --version
output version information and exit

Related Tags

#Linux# #free#