free 查看系统内存信息

free 命令用于查看系统内存状态。包括物理内存、虚拟内存、共享内存和系统缓存等。

-h	已人类可读的方式显示内存的使用情况。
[root@cenos79 log]# free -h
              total        used        free      shared  buff/cache   available
Mem:           1.8G        338M         93M         15M        1.4G        1.3G
Swap:          1.0G        235M        789M

备注:
1、total: 内存总量
2、used:  已使用的内存数量
3、free:  ?
4、shared:进程共享的内存数量
5、buff/cache ? 
6、available 可用的内存  



默认情况展示
[root@cenos79 log]# free 
              total        used        free      shared  buff/cache   available
Mem:        1882232      346684       95452       16108     1440096     1331964
Swap:       1049596      240896      808700


-b 	已 byte 为单位显示内存的使用情况。
[root@cenos79 log]# free -b
              total        used        free      shared  buff/cache   available
Mem:     1927405568   354955264    97787904    16494592  1474662400  1363980288
Swap:    1074786304   246677504   828108800
[root@cenos79 log]# 


-k 	已 kb 为单位显示内存的使用情况。
[root@cenos79 log]# free -k
              total        used        free      shared  buff/cache   available
Mem:        1882232      346684       95460       16108     1440088     1331964
Swap:       1049596      240896      808700


-m	已 mb 为单位显示内存的使用情况。
[root@cenos79 log]# free -m
              total        used        free      shared  buff/cache   available
Mem:           1838         338          93          15        1406        1300
Swap:          1024         235         789


-t 显示内存总和列。
[root@cenos79 log]# free -t
              total        used        free      shared  buff/cache   available
Mem:        1882232      346804       95336       16108     1440092     1331844
Swap:       1049596      240896      808700
Total:      2931828      587700      904036   -- -t 选项显示出总和列
[root@cenos79 log]# 


-s<间隔秒数> 根据指定的间隔秒数持续显示内存的情况。
[root@cenos79 log]# free -h -s 5  ## 没隔5s 显示一次内存使用情况
              total        used        free      shared  buff/cache   available
Mem:           1.8G        338M         93M         15M        1.4G        1.3G
Swap:          1.0G        235M        789M

              total        used        free      shared  buff/cache   available
Mem:           1.8G        338M         92M         15M        1.4G        1.3G
Swap:          1.0G        235M        789M

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值