free命令能夠查看內存使用的相關狀況緩存
一、用法spa
free [選項]
二、命令選項code
-b 以Byte爲單位顯示內存使用狀況
-k 以KB爲單位顯示內存使用狀況(默認以KB顯示)
-m 以MB爲單位顯示內存使用狀況
-g 以GB爲單位顯示內存使用狀況
-h 以合適的單位顯示內存使用狀況
-o 不顯示緩衝區調節列
-s<n> 動態觀察內存使用情況,每n秒刷新
-t 顯示內存總和列blog
三、實例內存
1)查看內存class
[root@izwz98rern8nx2xy82intfz /]# free total used free shared buff/cache available Mem: 1882232 448528 826408 47592 607296 1203604 Swap: 1049596 129920 919676 [root@izwz98rern8nx2xy82intfz /]# free -m total used free shared buff/cache available Mem: 1838 437 807 46 593 1175 Swap: 1024 126 898 [root@izwz98rern8nx2xy82intfz /]# free -h total used free shared buff/cache available Mem: 1.8G 437M 807M 46M 593M 1.1G Swap: 1.0G 126M 898M
四、說明sed
Mem 內存
Swap 虛擬內存
total 內存總數
used 已經使用的內存數
free 未分配的內存數
available 可用內存
bbuff/cache 緩存內存數di
tatal = used + free + buff/cache
available = free + buff/cache - 不可回收的部分 co