English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux free command

Linux Command Manual

The Linux free command is used to display memory status.

The free command displays memory usage, including physical memory, virtual swap file memory, shared memory segments, and system core used buffers, etc.

Syntax

free [-bkmotV][-s <Interval in seconds>]

Parameter Description:

  • -b Display memory usage in Byte units.
  • -k Display memory usage in KB units.
  • -m Display memory usage in MB units.
  • -h Display memory usage in appropriate units, up to three digits, and automatically calculate the corresponding unit value. Units include:

    B = bytes
    K = kilos
    M = megas
    G = gigas
    T = teras
  • -o Do not display buffer adjustment columns.
  • -s<Interval in seconds> Continuously observe memory usage status.
  • -t Display memory total column.
  • -V Display version information.

Online Examples

Display memory usage status

# free //Display memory usage information
total used free shared buffers cached
Mem: 254772 184568 70204 0 5692 89892
-/+ buffers/cache: 88984 165788
Swap: 524280 65116 459164

Display memory usage information in total form

# free -t //Query memory usage information in total form
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 //Every10s Execute a command once
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 Manual