Linux shell free 命令
Linux shell free命令用于显示内存状态。 free 指令会显示内存的使用情况,包括实体内存,虚拟的交换文件内存,共享内存区段,以及系统核心使用的缓冲区等。 free 命令语法格式 free [-bkmotV][-s <间隔秒数>] 选项 -b 以Byte为单位显示内存使用情况。 -k 以KB为单位显示内存使用情况。 -m 以MB为单位显示内存使用情况。 -o 不显示缓冲区调节列。 -s<间隔秒数> 持续观察内存使用状况。 -t 显示内存总和列。 -V 显示版本信息。 示例 显示内存使用情况 [root@localhost ~]# free total used free shared buff/cache available Mem: 999696 140056 631592 6884 228048 679508 Swap: 2097148 0 2097148 以总和的形式显示内存的使用信息 [root@localhost ~]# free -t total used free shared buff/cache available Mem: 999696 140020 631608 6884 228068 679544 Swap: 2097148 0 2097148 Total: 3096844 140020 2728756 周期性的查询内存使用信息 每10s 执行一次命令 [root@localhost ~]# free -s 10 total used free shared buff/cache available Mem: 999696 140036 631592 6884 228068 679528 Swap: 2097148 0 2097148 total used free shared buff/cache available Mem: 999696 140052 631576 6884 228068 679512 Swap: 2097148 0 2097148 返回上一级
Linux shell free命令用于显示内存状态。
free 指令会显示内存的使用情况,包括实体内存,虚拟的交换文件内存,共享内存区段,以及系统核心使用的缓冲区等。
free 命令语法格式
free [-bkmotV][-s <间隔秒数>]
选项
-b 以Byte为单位显示内存使用情况。 -k 以KB为单位显示内存使用情况。 -m 以MB为单位显示内存使用情况。 -o 不显示缓冲区调节列。 -s<间隔秒数> 持续观察内存使用状况。 -t 显示内存总和列。 -V 显示版本信息。示例
显示内存使用情况
[root@localhost ~]# free total used free shared buff/cache available Mem: 999696 140056 631592 6884 228048 679508 Swap: 2097148 0 2097148
以总和的形式显示内存的使用信息
[root@localhost ~]# free -t total used free shared buff/cache available Mem: 999696 140020 631608 6884 228068 679544 Swap: 2097148 0 2097148 Total: 3096844 140020 2728756
周期性的查询内存使用信息
每10s 执行一次命令
[root@localhost ~]# free -s 10 total used free shared buff/cache available Mem: 999696 140036 631592 6884 228068 679528 Swap: 2097148 0 2097148 total used free shared buff/cache available Mem: 999696 140052 631576 6884 228068 679512 Swap: 2097148 0 2097148
交流与评论