用途

查看系统内存(物理/虚拟/缓存/共享)使用情况

用法

free [-b | -k | -m | -g | -h] [-o] [-s delay ] [-c count ] [-a] [-t] [-l] [-V]

常用选项

选项 含义 说明
-b 单位byte switch displays the amount of memory in bytes;
-k 单位k switch (set by default) displays it in kilobytes;
-m 单位m switch displays it in megabytes;
-g 单位g switch displays it in gigabytes;
-h 人类可读方式 switch displays all output fields automatically scaled to the shortest (three digit) representation including the unit. That makes the values human readable.
-t 显示汇总行 switch displays a line containing the totals.
-o disables the display of a "buffer adjusted" line switch disables the display of a "buffer adjusted" line. If the -o option is not specified, free subtracts buffer memory from the used memory and adds it to the free memory reported.
-s 间隔秒数 间隔几秒重复刷新显示 switch activates continuous polling delay seconds apart. You may actually specify any floating point number for delay, usleep(3) is used for microsecond resolution delay times.
-c 次数 重复刷新显示总次数 switch used together with the -s switch interrupts the polling after count repetitions.
-l 显示low行 switch shows detailed low and high memory statistics.
-a 显示可用内存 switch shows the available memory (if supported by the running kernel and enabled with sysctl -w vm.mem-info_legacy_layout=0 ; shows zero when unsupported or disabled). The produced output is wider than 80 characters.
-V 显示程序版本信息 switch displays version information.

实践

1 显示内存使用情况

[root@vm ~]# free -h
total used free shared buffers cached
Mem: 2.9G 2.7G 209M 37M 11M 185M
-/+ buffers/cache: 2.5G 405M
Swap: 1.6G 1.2G 415M

参考资料

【1】man free

【2】每天一个linux命令(45):free 命令

http://www.cnblogs.com/peida/archive/2012/12/25/2831814.html

【3】Linux上的free命令详解

http://www.cnblogs.com/coldplayerest/archive/2010/02/20/1669949.html

最新文章

  1. MySql类似Oracle的dual虚拟表
  2. 用Javascript动态添加删除HTML元素实例 (转载)
  3. 全球酷站秀:15个顶尖的 CSS3 网站作品
  4. 虚拟机开机提示Operating System not found解决办法
  5. CentOS 6.5 安装Python 3.5
  6. javascript --学习闭包,自由变量
  7. C#中克隆随机数的三种方法(为什么我想到了茴字的四种写法
  8. Mysql shell 控制台---mysqlsh
  9. CSS中Position属性
  10. JMeter处理Cookie与Session
  11. HDU--1301--Jungle Roads(最小生成树)
  12. Spring+SpringMVC+MyBatis深入学习及搭建(八)——MyBatis查询缓存
  13. Cookie知识点总结
  14. 安装软件出现缺少vcruntime140.dll
  15. 51nod- 【1042 数字0-9的数量 】
  16. IOS使用批处理打包
  17. 用.Net如何访问Linux下目录
  18. Pair programming
  19. Redis主从切换
  20. python时间模块和random模块

热门文章

  1. 清北刷题班day3 morning
  2. BZOJ 3473
  3. flask中路由系统
  4. 题解报告:hdu 2188 悼念512汶川大地震遇难同胞——选拔志愿者(巴什博弈)
  5. Ambari是啥?主要是干啥的?
  6. P3368 【模板】树状数组 2(树状数组维护差分序列)
  7. js基础---object对象
  8. [Windows Server 2008] Ecshop安全设置
  9. Linux Shell 小知识
  10. Python 之selenium+phantomJS斗鱼抓取案例