用途

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

用法

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. [Swift通天遁地]七、数据与安全-(8)创建普通PDF文档和加密PDF文档

    ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...

  2. ashx 文件的使用

    它就类似.aspx文件,用于处理传入到服务器的HTTP请求,但它不会像.aspx文件那样要返回处理结果和大量HTML,它可以返回简单的字符串.图片等. 百度百科定义链接:http://baike.ba ...

  3. eclipse-html插件的安装

    需求:需要在eclipse里面编辑html和jsp,语法高亮和语法提示,自动补全等. 1.下载GEF(依赖包): http://www.eclipse.org/downloads/download.p ...

  4. Linq学习(五)-多表连接

    本将主要介绍 内连接与 外连接 1.join Linq to sql from a in Blog_Users join b in Blog_UserInfo on a.UserId equals b ...

  5. win7 硬盘安装suse双系统启动顺序更改

    使用win7硬盘安装suse双系统之后,首先面临的问题是,PC默认启动的系统更改的问题,有些人可能想默认启动是win7,只有在使用linux的时候在去选择suse系统,这里我告诉大家更改的办法: 首先 ...

  6. SQL基本操作——case end

    case end进行多条件的判断 --查看Person表 select * from Person --对math字段进行条件判断 select name,数学成绩= case then '优' th ...

  7. 搜索条件两个时间,通过php数组排序,保证select语句between时间 前小后大

    //搜索条件两个时间,通过数组排序,保证select语句between时间 前小后大 $sort_array=[$_POST['clockDate1'],$_POST['clockDate2']]; ...

  8. 在把table表格中的数据导出到Excel的时候,以科学计数法显示位数多的数字时怎么解决?

    sbHtml.AppendFormat("<td> {0}</td>", data[i].IDcard.ToString()); sbHtml.Append ...

  9. 如何将本地项目上传到gitlab上?

    git push后需要输入用户名,密码 这是上传成功显示的页面 打开gitLab项目地址检查代码是否被正确上传 上传前: 上传后 这就完成将项目上传到gitlab了

  10. ionic4封装样式原理

    查看文档: https://www.cnblogs.com/WhiteCusp/p/4342502.html https://www.jianshu.com/p/bb291f9678e1 https: ...