码迷,mamicode.com
首页 > 系统相关 > 详细

N天学习一个Linux命令之free

时间:2018-07-19 13:32:28      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:ali   def   wap   int   linux   tail   lob   poll   ilo   

用途

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

用法

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

N天学习一个Linux命令之free

标签:ali   def   wap   int   linux   tail   lob   poll   ilo   

原文地址:https://www.cnblogs.com/wadeyu/p/9335091.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!