free命令是監控Linux內存使用最經常使用的命令,能夠顯示當前系統未使用的和已使用的內存數目,還能夠顯示被內核使用的內存緩衝區。緩存
-b:以Byte爲單位顯示內存使用狀況; -k:以KB爲單位顯示內存使用狀況; -m:以MB爲單位顯示內存使用狀況; -o:不顯示緩衝區調節列; -s<間隔秒數>:持續觀察內存使用情況; -t:顯示內存總和列; -V:顯示版本信息。
[root@xiesshavip002 ~]# free total used free shared buff/cache available Mem: 1016904 76300 669468 288 271136 810556 Swap: 0 0 0 [root@xiesshavip002 ~]# total:內存總數; used:已經使用的內存數; free:空閒的內存數; shared:當前已經廢棄不用; buffers Buffer:緩存內存數; cached Page:緩存內存數。
[root@xiesshavip002 ~]# free --help
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 -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 For more details see free(1). [root@xiesshavip002 ~]#