用途

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

用法

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的更多相关文章

  1. N天学习一个Linux命令之帮助命令:man

    前言 工作中每天都在使用常用的命令和非常用的命令,忘记了用法或者参数,都会bing一下,然后如此循环.一直没有真正的系统的深入的去了解命令的用法,我决定打破它.以前看到有人,每天学习一个linux命令 ...

  2. N天学习一个linux命令之ping

    用途 检测主机是否可到达,也就是说,目标主机是否可以联网,还可以用于检测网速.通过发送ICMP ECHO_REQUEST数据包检测. 用法 ping [options] destination 常用选 ...

  3. N天学习一个linux命令之kill

    用途 用于终止进程 用法 kill [-s signal|-p] [--] pid... kill -l [signal] 说明 1.默认发送信号15(请求终止进程,程序可以捕获,操作系统会杀死没有对 ...

  4. N天学习一个linux命令之du

    用途 统计文件或者目录占用硬盘空间大小 用法 du [OPTION] [FILE]du [OPTION] --files0-from=F 常用参数 -a, --all统计所有文件,不仅仅是目录 -b, ...

  5. N天学习一个linux命令之scp

    用途 通过ssh通道,不同主机之间复制文件 用法 scp [options] [user@host:]file1 [user2@host2:]file2 常用参数 -1使用 ssh 1协议 -2使用s ...

  6. 每天学习一个Linux命令-目录

    在工作中总会零零散散使用到各种Linux命令,从今天开始详细的学习一下linux常用命令,坚持每天一个命令,学习的主要参考资料为: 1.竹子-博客(https://www.cnblogs.com/pe ...

  7. N天学习一个linux命令之umask

    前言 umask不是linux命令,而是shell内置的指令,俗称用户权限掩码,用于对用户创建的文件和目录设置默认权限.默认的权限掩码是0022,也就是说新创建的文件权限是0644,新创建的目录权限是 ...

  8. N天学习一个linux命令之ip

    用途 show / manipulate routing, devices, policy routing and tunnels 用法 通用格式 ip [ OPTIONS ] OBJECT { CO ...

  9. N天学习一个Linux命令之grep

    前言任何系统都会出问题,出了问题一般怎么排查BUG?这个时候程序中记录的异常日志以及关键节点的日志就非常重要了,面对一大堆的日志文件,怎么找出我们需要的有用信息呢?linux中可以使用grep命令查找 ...

随机推荐

  1. web自动化测试—selenium操作游览器属性

    # coding=utf-8'''web游览器属性: 页面最大化 maximize_window() 获取当前页面地址 current_url 代码 page_source title title 后 ...

  2. 解决input输入框在iOS中有阴影问题

    input{ -webkit-appearance: none; }

  3. 【洛谷2469/BZOJ1927】[SDOI2010]星际竞速(费用流/最小路径覆盖)

    题目: 洛谷2469 分析: 把题目翻译成人话:给一个带边权的DAG,求一个路径覆盖方案使路径边权总和最小.从点\(i\)开始的路径需要额外加上\(A_i\)的权值. 回xian忆chang一xue下 ...

  4. websocket的原理

    首先明确几点: 1. websocket是一种协议.是html5的一种新协议: 2. 与http的区别是,它是一种双向通信协议,服务器和客户端都能主动向对方发送或接受数据: 3. websocket需 ...

  5. [转]android 获取 imei号码

    核心代码: Imei = ((TelephonyManager) getSystemService(TELEPHONY_SERVICE)) .getDeviceId(); 1.加入权限 在manife ...

  6. MVC系列学习(四)-初识Asp.NetMVC框架

    注:本文章从伯乐那盗了两张图,和一些文字: 1.MVC设计模式 与 Asp.Net Mvc框架 a.MVC设计模式 MVC设计模式 是一种 软件设计模式,将业务逻辑 与 界面显示 分离,并通过某种方式 ...

  7. 6.11---@RequestMapping注解的6+2个属性---6.11

    produces:它的作用是指定返回值类型,不但可以设置返回值类型还可以设定返回值的字符编码: consumes: 指定处理请求的提交内容类型(Content-Type),例如application/ ...

  8. 【转】Java 集合系列04之 fail-fast总结(通过ArrayList来说明fail-fast的原理、解决办法)

    概要 前面,我们已经学习了ArrayList.接下来,我们以ArrayList为例,对Iterator的fail-fast机制进行了解.内容包括::1 fail-fast简介2 fail-fast示例 ...

  9. 使用Dreamweaver在一张图片上添加多个热点链接

    所有代码: <html> <head> <meta charset="utf-8"> <title>无标题文档</title& ...

  10. LinearLayout中间布局填充出现的问题

    线性布局如何中间填充,会挤掉他下面的布局,所以中间填充使用layout_weight属性.