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
|
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
|