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, --bytesshow output in bytes-k, --kiloshow output in kilobytes-m, --megashow output in megabytes-g, --gigashow output in gigabytes--terashow output in terabytes--petashow output in petabytes-h, --humanshow human-readable output--siuse powers of 1000 not 1024-l, --lohishow detailed low and high memory statistics-t, --totalshow total for RAM + swap-s N, --seconds Nrepeat printing every N seconds-c N, --count Nrepeat printing N times, then exit-w, --widewide output--helpdisplay this help and exit-V, --versionoutput version information and exit