Free command
Function description
the free command is used to display system memory status, including system physical memory, virtual memory, shared memory, and system cache. Use the following:
free [options] [-s (interval seconds)] |
Command parameters
Options |
Meaning |
-M |
Display memory usage in megabytes |
-B |
Display memory usage in bytes |
-K |
Display memory usage in kilobytes |
-T |
Show Memory Sum column |
-S (interval seconds) |
Continuously displays memory usage based on the number of seconds specified |
-C |
Count, which needs to be used in conjunction with the-s option |
-O |
Do not display system buffer columns |
Common combinations:
free-m free-m-S 1 #每秒以MB为单位, displaying system memory details free-c 4-s 2 #每2秒执行一次, showing system memory usage, total 4 |
Example
Use the- m parameter to view memory utilization
[[email protected] ~]# free-m mem: 1826 1487 &NBSP ; 8 206 1528 swap: 3071 0 3071 /p> |
Description
As can be seen from the above display, the total memory is 2G, has used 132MB, the available memory has 1487MB. Swap swap is a zone size of 3G and is not used by the system.
Use the-s parameter to view memory utilization per second
[[email protected] ~]# free-m-S 1 Total used free shared buff/cache available mem:1826 132 1488 8 206 1528 swap:3071 0 3071
Total used free shared buff/cache available mem:1826 132 1488 8 206 1528 swap:3071 0 3071
Total used free shared buff/cache available mem:1826 132 1488 8 206 1528 swap:3071 0 3071
^c [[Email protected] ~] |
use the-c parameter, display memory information in 2 seconds, total 3 times
[email protected] ~]# free-c 3-s 2 Total used free shared buff/cache available mem:1870516 135212 1523720 8624 211584 1565692 swap:3145724 0 3145724
Total used free shared buff/cache available mem:1870516 135228 1523704 8624 211584 1565676 swap:3145724 0 3145724
Total used free shared buff/cache available mem:1870516 135228 1523704 8624 211584 1565676 swap:3145724 0 3145724 [Email protected] ~]# |
Learn from:
Karst "Progressive Linux"
This article is from the "Zhao Dongwei blog" blog, make sure to keep this source http://zhaodongwei.blog.51cto.com/4233742/1874965
Linux commands: Free command-show memory information