Linux free命令:显示系统内存情况

Linux free命令用于显示内存状态,显示内存的使用情况,包括物理内存,交换内存,以及系统核心使用的缓冲区等,这些信息是通过解析文件 /proc/meminfo 而得到的。

语法格式:free [参数]

常用参数:

-b以Byte显示内存使用情况
-k以kb为单位显示内存使用情况
-m以mb为单位显示内存使用情况
-g以gb为单位显示内存使用情况
-s持续显示内存
-t显示内存使用总合

参考实例

显示内存使用情况:

[root@bunian ~]# free 
              total        used        free      shared  buff/cache   available
Mem:        3880176     1836392      145816       16904     1897968     1783936
Swap:       1049596      338524      711072

用MB显示内存使用情况:

[root@bunian ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           3789        1764         165          16        1859        1771
Swap:          1024         330         694

用KB显示内存使用情况:

[root@bunian ~]# free -K
              total        used        free      shared  buff/cache   available
Mem:        3880176     1796452      171472       16904     1912252     1823828
Swap:       1049596      338524      711072

以总和的形式显示内存的使用信息:

[root@bunian ~]# free -t 
              total        used        free      shared  buff/cache   available
Mem:        3880176     1784824      179252       16904     1916100     1835504
Swap:       1049596      338524      711072
Total:      4929772     2123348      890324

周期性查询内存使用情况:

[root@bunian ~]# free -s 15
              total        used        free      shared  buff/cache   available
Mem:        3880176     1869656      144816       16904     1865704     1750692
Swap:       1049596      338524      711072

              total        used        free      shared  buff/cache   available
Mem:        3880176     1891672      170604       16904     1817900     1728700
Swap:       1049596      338524      711072

              total        used        free      shared  buff/cache   available
Mem:        3880176     1882656      170620       16896     1826900     1737724
Swap:       1049596      338524      711072
© 版权声明
THE END
喜欢就支持一下吧
点赞107赞赏 分享
评论 抢沙发
头像
欢迎光临不念博客,留下您的想法和建议,祝您有愉快的一天~
提交
头像

昵称

取消
昵称

    暂无评论内容