Latest web development tutorials

Linux free Command

Linux command Daquan Linux command Daquan

Linux free command displays memory status.

free command displays memory usage, including physical memory, virtual memory swap file, shared memory segments, as well as the buffer system core like used.

grammar

free [-bkmotV][-s <间隔秒数>]

Parameter Description:

  • -b Displays in Byte memory usage.
  • -k in KB display memory usage.
  • -m in MB display memory usage.
  • -o not adjust the display buffer column.
  • -s <number of seconds> continue to observe the memory usage.
  • -t displays the sum of memory columns.
  • -V Display version information.

Examples

Display memory usage

# free //显示内存使用信息
total used free shared buffers cached
Mem: 254772 184568 70204 0 5692 89892
-/+ buffers/cache: 88984 165788
Swap: 524280 65116 459164

In the form of the sum of display memory usage information

# free -t //以总和的形式查询内存的使用信息
total used free shared buffers cached
Mem: 254772 184868 69904 0 5936 89908
-/+ buffers/cache: 89024 165748
Swap: 524280 65116 459164
Total: 779052 249984 529068

Periodically query memory usage information

# free -s 10 //每10s 执行一次命令
total used free shared buffers cached
Mem: 254772 187628 67144 0 6140 89964
-/+ buffers/cache: 91524 163248
Swap: 524280 65116 459164

total used free shared buffers cached
Mem: 254772 187748 67024 0 6164 89940
-/+ buffers/cache: 91644 163128
Swap: 524280 65116 459164

Linux command Daquan Linux command Daquan