Skip to content

What is free-h

Overview

Let's take a closer look at the output of the free -h command.

root@4ffda325c62d:/usr/bin/tower# free -h
               total        used        free      shared  buff/cache   available
Mem:           5.8Gi       652Mi       5.1Gi       4.1Mi       366Mi       5.2Gi
Swap:             0B          0B          0B

So what is it? And how to implement

free -h is a command that displays the total amount of free and used physical and swap memory in the system, as well as the buffers and cache used by the kernel.

The columns of the output are as follows:

Column Name Description Value
total The total amount of physical memory installed in the system 5.8Gi
used The amount of physical memory currently in use by the system 652Mi
free The amount of physical memory not currently in use by the system 5.1Gi
shared The amount of physical memory being used by the system for inter-process communication 4.1Mi
buff/cache The amount of physical memory being used by the kernel for caching disk blocks and other data 366Mi
available An estimate of how much memory is available for starting new applications, without swapping 5.2Gi
Swap The total amount of swap space available on the system 0B
used The amount of swap space currently in use by the system 0B
free The amount of swap space not currently in use by the system 0B

This command is available on most Linux distributions, including Ubuntu, Debian, CentOS, RHEL, and openSUSE. However, the output may vary slightly depending on the distribution.