说明
查询当前内存使用状况以及剩余内存状况
free -h
free -h
含义
适合人阅读的单位显示内存,最大为三位数,自动计算对应的单位值。单位有:
B = bytes
K = kilos
M = megas
G = gigas
T = teras
结果
解释:
- total: 内存总数
- used: 已经使用内存数
- free: 完全空闲内存
- shared: 多个进程共享的内存
- buffers: 用于块设备数据缓冲,记录文件系统metadata(目录,权限,属性等)
- cached: 用于文件内容的缓冲
- available:真正剩余的可被程序应用的内存数
free -s
每2s 执行一次命令
free -s 2
所有参数
free --help
显示结果:
Usage:
free [options]
Options:
-b, --bytes show output in bytes 以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).
更多解释见:
https://www.runoob.com/linux/linux-comm-free.html
感谢:
https://blog.csdn.net/jiahao1186/article/details/103477051
