命 令: free
功能说明:显示内存状态。
语 法: free [-bkmotV][-s ]
补充说明:free指令会显示内存的使用情况,包括实体内存,虚拟的交换文件内存,共享内存区段,以及系统核心使用的缓冲区等。
参 数:
-b 以Byte为单位显示内存使用情况。
-k 以KB为单位显示内存使用情况。
-m 以MB为单位显示内存使用情况。
-o 不显示缓冲区调节列。
-s 持续观察内存使用状况。
-t 显示内存总和列。
-V 显示版本信息。
[root@localhlocalhost ~]# free -c
free: option requires an argument -- c
usage: free [-b|-k|-m|-g] [-l] [-o] [-t] [-s delay] [-c count] [-V]
-b,-k,-m,-g show output in bytes, KB, MB, or GB
-l show detailed low and high memory statistics
-o use old format (no -/+buffers/cache line)
-t display total for RAM + swap
-s update every [delay] seconds
-c update [count] times
-V display version information and exit
[root@localhlocalhost ~]# free -V
procps version 3.2.7
[root@localhlocalhost ~]#
[root@localhlocalhost ~]# free 默认情况下为k
total used free shared buffers cached
Mem: 515444 450008 65436 0 37640 309752
-/+ buffers/cache: 102616 412828
Swap: 522104 0 522104
[root@localhlocalhost ~]# free -k
total used free shared buffers cached
Mem: 515444 450008 65436 0 37680 309752
-/+ buffers/cache: 102576 412868
Swap: 522104 0 522104
[root@localhlocalhost ~]# free -b
total used free shared buffers cached
Mem: 527814656 460808192 67006464 0 38592512 317186048
-/+ buffers/cache: 105029632 422785024
Swap: 534634496 0 534634496
[root@localhlocalhost ~]# free -m
total used free shared buffers cached
Mem: 503 439 63 0 37 302
-/+ buffers/cache: 99 403
Swap: 509 0 509
[root@localhlocalhost ~]# free -g
total used free shared buffers cached
Mem: 0 0 0 0 0 0
-/+ buffers/cache: 0 0
Swap: 0 0 0
[root@localhlocalhost ~]# free -l
total used free shared buffers cached
Mem: 515444 450256 65188 0 38176 309752
Low: 515444 450256 65188
High: 0 0 0
-/+ buffers/cache: 102328 413116
Swap: 522104 0 522104
[root@localhlocalhost ~]# free -o
total used free shared buffers cached
Mem: 515444 450256 65188 0 38216 309752
Swap: 522104 0 522104
[root@localhlocalhost ~]#
[root@localhlocalhost ~]# free -s 10 每隔十秒动态显示一次
total used free shared buffers cached
Mem: 515444 450752 64692 0 38376 309752
-/+ buffers/cache: 102624 412820
Swap: 522104 0 522104
total used free shared buffers cached
Mem: 515444 450752 64692 0 38392 309752
-/+ buffers/cache: 102608 412836
Swap: 522104 0 522104
嘿嘿 希望对您有所帮助