System administration

Linux free command

Display memory use. The -h flag chooses human-readable units.

Availability: Common Linux commands; shell built-ins and external implementations may differ by distribution.中文

Syntax

free [OPTION]...

Examples

Display memory and swap totals in readable units.

free -h

Refresh memory statistics every two seconds.

free -h -s 2

Parameters, options and clauses

Option / clauseDescription
-h, --humanShow sizes in human-readable units.
-b, --bytesShow sizes in bytes.
-k, --kibiShow sizes in kibibytes.
-m, --mebiShow sizes in mebibytes.
-g, --gibiShow sizes in gibibytes.
-s SECONDS, --seconds=SECONDSRepeat the display at the given interval.
-w, --wideUse a wide output format.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory