龙空技术网

常用linux命令:free

tzhennan 120

前言:

现在大家对“linux命令free m”可能比较珍视,小伙伴们都想要学习一些“linux命令free m”的相关内容。那么小编同时在网络上网罗了一些对于“linux命令free m””的相关知识,希望姐妹们能喜欢,咱们一起来了解一下吧!

free命令用于显示系统内存的使用情况,包括物理内存、交换内存(swap)和内核缓冲区内存等信息

$ free              total        used        free      shared  buff/cache   availableMem:        8008880     4432516      346416      401260     3229948     2808180Swap:             0           0           0# 说明total:表示物理内存总大小(total=used+free+buff/cache)used:表示已使用内存大小free:表示可用内存大小shared:表示共享的内存大小buff/cache:表示磁盘缓存大小available:实际可用内存大小# 以m(兆)为单位显示内存使用情况$ free -htl              total        used        free      shared  buff/cache   availableMem:           7.6G        4.2G        339M        391M        3.1G        2.7GLow:           7.6G        7.3G        339MHigh:            0B          0B          0BSwap:            0B          0B          0BTotal:         7.6G        4.2G        339M# 常用选项说明:-b  以Byte为单位显示内存使用情况-k  以KB为单位显示内存使用情况-m  以MB为单位显示内存使用情况-h  以合适的单位显示内存使用情况,最大为三位数,自动计算对应的单位值-t  显示内存总和信息(Total对应的行)-l  显示最低和最高的内存统计信息(Low和Hight对应的行)# 定时查询内存使用信息// 每5s执行一次查询命令$ free -s 5              total        used        free      shared  buff/cache   availableMem:        8008880     2937888     2689416     1081800     2381576     3637272Swap:             0           0           0              total        used        free      shared  buff/cache   availableMem:        8008880     2940124     2687160     1081800     2381596     3635044Swap:             0           0           0              total        used        free      shared  buff/cache   availableMem:        8008880     2942348     2684852     1081800     2381680     3632776Swap:             0           0           0# 通过--help命令可以查看free命令的更多可用选项$ free --helpUsage: free [options]Options: -b, --bytes         show output in bytes -k, --kilo          show output in kilobytes -m, --mega          show output in megabytes -g, --giga          show output in gigabytes     --tera          show output in terabytes     --peta          show output in petabytes -h, --human         show human-readable output     --si            use powers of 1000 not 1024 -l, --lohi          show detailed low and high memory statistics -t, --total         show total for RAM + swap -s N, --seconds N   repeat printing every N seconds -c N, --count N     repeat printing N times, then exit -w, --wide          wide output     --help     display this help and exit -V, --version  output version information and exitFor more details see free(1).

标签: #linux命令free m