O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

free — stdin  stdout  - file  -- opt  --help  --version

Synopsis

free [options]

The free command displays memory usage in kilobytes:

$ free
          total      used    free shared buffers cached
Mem:     523812    491944   31868      0   67856 199276
-/+ buffers/cache: 224812  299000 
Swap:    530104         0  530104

The Linux kernel reserves as much memory as possible for caching purposes, so your best estimate of free RAM in the preceding output is in the buffers/cache row, free column (i.e., 299000K).

Useful options

-s N

Run continuously and update the display every N seconds.

-b

Display amounts in bytes.

-m

Display amounts in megabytes.

-t

Add a totals row at the bottom.

-o

Don’t display the “buffers/cache” row.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required