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

Comando free di Linux

大全命令Linux

Il comando free di Linux viene utilizzato per mostrare lo stato della memoria.

Il comando free mostra l'uso della memoria, inclusi la memoria fisica, la memoria del file di swap virtuale, le sezioni di memoria condivise e i buffer utilizzati dal nucleo del sistema.

Sintassi

free [-bkmotV][-s <secondi di intervallo>]

Descrizione dei parametri

  • -b  Mostra l'uso della memoria in Byte.
  • -k  Mostra l'uso della memoria in KB.
  • -m  Mostra l'uso della memoria in MB.
  • -h  Mostra l'uso della memoria in unità appropriate, fino a tre cifre, calcolato automaticamente il valore dell'unità corrispondente. Le unità sono:

    B = bytes
    K = kilos
    M = megas
    G = gigas
    T = teras
  • -o  不显示缓冲区调节列。
  • -s<间隔秒数>  持续观察内存使用状况。
  • -t  显示内存总和列。
  • -V  显示版本信息。

示例在线

显示情况使用内存

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

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

# 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

查询信息使用内存周期性

# 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