N天学习一个Linux命令之free
用途
查看系统内存(物理/虚拟/缓存/共享)使用情况
用法
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的更多相关文章
- N天学习一个Linux命令之帮助命令:man
前言 工作中每天都在使用常用的命令和非常用的命令,忘记了用法或者参数,都会bing一下,然后如此循环.一直没有真正的系统的深入的去了解命令的用法,我决定打破它.以前看到有人,每天学习一个linux命令 ...
- N天学习一个linux命令之ping
用途 检测主机是否可到达,也就是说,目标主机是否可以联网,还可以用于检测网速.通过发送ICMP ECHO_REQUEST数据包检测. 用法 ping [options] destination 常用选 ...
- N天学习一个linux命令之kill
用途 用于终止进程 用法 kill [-s signal|-p] [--] pid... kill -l [signal] 说明 1.默认发送信号15(请求终止进程,程序可以捕获,操作系统会杀死没有对 ...
- N天学习一个linux命令之du
用途 统计文件或者目录占用硬盘空间大小 用法 du [OPTION] [FILE]du [OPTION] --files0-from=F 常用参数 -a, --all统计所有文件,不仅仅是目录 -b, ...
- N天学习一个linux命令之scp
用途 通过ssh通道,不同主机之间复制文件 用法 scp [options] [user@host:]file1 [user2@host2:]file2 常用参数 -1使用 ssh 1协议 -2使用s ...
- 每天学习一个Linux命令-目录
在工作中总会零零散散使用到各种Linux命令,从今天开始详细的学习一下linux常用命令,坚持每天一个命令,学习的主要参考资料为: 1.竹子-博客(https://www.cnblogs.com/pe ...
- N天学习一个linux命令之umask
前言 umask不是linux命令,而是shell内置的指令,俗称用户权限掩码,用于对用户创建的文件和目录设置默认权限.默认的权限掩码是0022,也就是说新创建的文件权限是0644,新创建的目录权限是 ...
- N天学习一个linux命令之ip
用途 show / manipulate routing, devices, policy routing and tunnels 用法 通用格式 ip [ OPTIONS ] OBJECT { CO ...
- N天学习一个Linux命令之grep
前言任何系统都会出问题,出了问题一般怎么排查BUG?这个时候程序中记录的异常日志以及关键节点的日志就非常重要了,面对一大堆的日志文件,怎么找出我们需要的有用信息呢?linux中可以使用grep命令查找 ...
随机推荐
- canvas 文字转化为粒子
var canvas = document.createElement('canvas'); var cxt = canvas.getContext('2d'); var W = canvas.wid ...
- Kubernetes 配置 Taint 和 Toleration(污点和容忍)
通过污点和容忍让pod运行在特定节点上 参考官网:https://k8smeetup.github.io/docs/concepts/configuration/taint-and-toleratio ...
- 聪明的kk --- 搜索超时
二话没说上去搜索 , 果不其然 华丽超时 . #include<stdio.h> #include<string.h> #include<math.h> #incl ...
- 【NOIP2016】DAY1 T2 天天爱跑步
[NOIP2016]DAY1 T2 天天爱跑步 Description 小c同学认为跑步非常有趣,于是决定制作一款叫做<天天爱跑步>的游戏.?天天爱跑步?是一个养成类游戏,需要玩家每天按时 ...
- DataFrame编程模型初谈与Spark SQL
Spark SQL在Spark内核基础上提供了对结构化数据的处理,在Spark1.3版本中,Spark SQL不仅可以作为分布式的SQL查询引擎,还引入了新的DataFrame编程模型. 在Spark ...
- T-SQL查询基础
今天来带大家了解下在sql server 中的查询机制 使用select语句进行查询 1.查询所有的数据行和列 select * from student 2.查询部分行和列 select scode ...
- es6杂记
es6杂记 let 和 const let 仅在代码块里有效 { let a = 10; var b = 1; } a // ReferenceError: a is not defined. b / ...
- js基础---object对象
//**********************************复杂JSON举例**************************************** var Jsondata={d ...
- 【转】Centos7 ftp 配置及报错处理
原文链接: https://www.cnblogs.com/GaZeon/p/5393853.html Centos7网络配置,vsftpd安装及530报错解决 今天在虚拟机安装CentOS7,准备全 ...
- JavaScript 封装插件学习笔记(一)
此篇只是笔记,在借鉴.参考.模仿的过程,可能不完整,请多指教! 定义插件名称要注意命名冲突,防止全局污染. 1.第一种Javascript对象命名:(Javascript语言是“先解析,后运行”,解析 ...