Linux free命令

free命令可以查看内存使用的相关情况

1、用法

free [选项]

2、命令选项

-b   以Byte为单位显示内存使用情况
-k    以KB为单位显示内存使用情况(默认以KB显示)
-m    以MB为单位显示内存使用情况
-g    以GB为单位显示内存使用情况
-h    以合适的单位显示内存使用情况
-o    不显示缓冲区调节列
-s<n>   动态观察内存使用状况,每n秒刷新
-t    显示内存总和列

3、实例

1)查看内存

[root@mini ~]# free 
              total        used        free      shared  buff/cache   available
Mem:         739932      124564      355460        6088      259908      460320
Swap:       1044476           0     1044476
[root@mini ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:            722         121         347           5         253         449
Swap:          1019           0        1019
[root@mini ~]# free -h
              total        used        free      shared  buff/cache   available
Mem:           722M        121M        346M        5.9M        253M        449M
Swap:          1.0G          0B        1.0G

 

4、说明

Mem           内存
Swap             虚拟内存
total            内存总数
used                 已经使用的内存数
free                   未分配的内存数
available          可用内存
bbuff/cache     缓存内存数

tatal = used + free + buff/cache
available = free + buff/cache - 不可回收的部分   

posted @ 2018-07-23 10:45  nonzero  阅读(1042)  评论(0编辑  收藏  举报