free Linux Commands

What is Linux free Command?

Explanation

free COMMAND:

free command displays information about free and used memory on the system.

SYNTAX :


free [options] [-V]

OPTIONS:


- b Prints the memory information in bytes.
- k Prints the memory information in kilo-bytes.
- m Prints the memory information in mega-bytes.
- s delay Prints the output continously. Type the delay time to print the output continously.
- t prints a line containing totals.

EXAMPLE:


  1. To Print the memory size information:
    free
    total
    used
    free
    shared buffers cached Mem:
    223740
    219492
    4248
    0
    3756
    73212 -/+ buffers/cache: 142524
    81216 Swap:
    1052216
    66732
    985484

    The free command displays all the memory information of the system like total memory used and free memory.
  2. To Print memory information from file:
    cat /proc/meminfo
    MemTotal:
    223740 kB MemFree:
    8512 kB Buffers:
    4432 kB Cached:
    67860 kB SwapCached:
    15032 kB Active:
    172484 kB Inactive:
    20168 kB HighTotal:
    0 kB HighFree:
    0 kB LowTotal:
    223740 kB LowFree:
    8512 kB SwapTotal:
    1052216 kB SwapFree:
    985488 kB Dirty:
    52 kB Writeback:
    0 kB Mapped:
    166064 kB Slab:
    14860 kB Committed_AS:
    541000 kB PageTables:
    3260 kB VmallocTotal:
    794616 kB VmallocUsed:
    3056 kB VmallocChunk:
    791084 kB HugePages_Total:
    0 HugePages_Free:
    0 Hugepagesize:
    4096 kB

    The above command prints the memory information of the system.

Ask Questions

Ask Question