linux 命令:free 详解

 free 是展示服务器内存使用情况的命令,下边是我翻译的帮助文档,请过目

Usage:
 free [options]

Options:
 -b, --bytes         以 b 为单位展示结果
 -k, --kilo          以 kb 为单位展示结果
 -m, --mega          以 mb 为单位展示结果
 -g, --giga          以 gb 为单位展示结果
     --tera          以 tb 为单位展示结果
     --peta          以 pb 为单位展示结果
 -h, --human         以可读格式展示结果
     --si            以1000为基底而不是1024
 -l, --lohi          展示内存使用量的最大和最小值
 -t, --total         在最后一行展示 RAM + swap 的总和
 -s N, --seconds N   每 N 秒刷新
 -c N, --count N     重复刷新 N 次,然后退出
 -w, --wide          显示宽度增加

     --help          显示此帮助信息并退出
 -V, --version       显示版本信息并退出

使用实例:

1. free -b/k/m/g:各种不同单位展示

[root@server dir]# free -b
              total        used        free      shared  buff/cache   available
Mem:     1818816512   337682432   660086784      442368   821047296  1324638208
Swap:             0           0           0
[root@server dir]# free -k
              total        used        free      shared  buff/cache   available
Mem:        1776188      329708      644676         432      801804     1293656
Swap:             0           0           0
[root@server dir]# free -m
              total        used        free      shared  buff/cache   available
Mem:           1734         321         629           0         783        1263
Swap:             0           0           0
[root@server dir]# free -g
              total        used        free      shared  buff/cache   available
Mem:              1           0           0           0           0           1
Swap:             0           0           0

2. free -h: 以可读格式展示

[root@server dir]# free -h
              total        used        free      shared  buff/cache   available
Mem:           1.7G        321M        629M        432K        783M        1.2G
Swap:            0B          0B          0B

3. free -l: 展示最大和最小值

[root@server dir]# free -l
              total        used        free      shared  buff/cache   available
Mem:        1776188      329536      644840         432      801812     1293828
Low:        1776188     1131348      644840
High:             0           0           0
Swap:             0           0           0

4. free -t: 最后一行展示RAM+swap的总和

[root@server dir]# free -t
              total        used        free      shared  buff/cache   available
Mem:        1776188      329388      644988         432      801812     1293976
Swap:             0           0           0
Total:      1776188      329388      644988
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值