free command

LINUX-Frequently used commands

free command Checking the memory status of Linux
Syntax
free   [Option]
The free command is a command to check the memory status of Linux.
The items displayed include total memory, used space, free space, buffers, and cache. These memory status is displayed in real time.
The free command displays the data based on the "/proc/meminfo" file, so you can run "cat /proc/meminfo will give you the same result.
Frequently used options
-b   Display memory capacity in bytes
-k   Display memory capacity in kilobytes
-m  Display memory capacity in megabytes
-g   Display memory capacity in gigabytes
-t    Show total memory and swap space
Example: Checking the memory status of Linux.
$ free

                       total          used          free      shared     buffers      cached
Mem:       8061116    7944800     116316          220       7172      105892
-/+ buffers/cache:     7831736     229380
Swap:      2097148    2097148              0
Mem Main memory size(※1)
/+buffers/cache Memory size including page cache and buffer cache
Swap Memory size of the swap area
total Total capacity(※2)
used Capacity for use
free free space
shared Shared memory (memory in an area that can be shared between processes)
buffers buffer cache
cached page cache
※1:The size of the main memory does not include the buffer cache and page cache.
※2:Memory used by the OS for disk cache (page cache, buffer cache, etc.) is also included.
Example: Display the total physical memory and swap space
$ free -mt  

                      total       used        free     shared     buffers     cached
Mem:             7872       7750        121            0             3            89
-/+ buffers/cache:         7657        214 
Swap:            2047       2047            0
Total:                9920        9798          121
Copied title and URL