Página 1 de 1

Mostrar la cantidad de memoria libre y utilizada en el sistema

Publicado: 21 Jun 2024, 13:00
por Guillermo
Comandos Linux para consultar hardware

- free: Display amount of free and used memory in the system
Hay varias formas de obtener información sobre la memoria del sistema. Como usuario, la cantidad total de memoria disponible y en uso suelen ser los valores de interés. Una fuente de información sería ejecutar el comando free junto con el parámetro -m para utilizar megabytes en la salida:

Código: Seleccionar todo

guillermo@maquina:~$ free -m
               total       usado       libre  compartido   búf/caché   disponible
Mem:            7831        2760        2683         284        2968        5070
Inter:           975           0         975
- Man free (Manual de free)
NAME
free - Display amount of free and used memory in the system

SYNOPSIS
free [options]

DESCRIPTION
free displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches
used by the kernel. The information is gathered by parsing /proc/meminfo. The displayed columns are:

total Total installed memory (MemTotal and SwapTotal in /proc/meminfo)

used Used or unavailable memory (calculated as total - available)

free Unused memory (MemFree and SwapFree in /proc/meminfo)

shared Memory used (mostly) by tmpfs (Shmem in /proc/meminfo)

buffers
Memory used by kernel buffers (Buffers in /proc/meminfo)

cache Memory used by the page cache and slabs (Cached and SReclaimable in /proc/meminfo)

buff/cache
Sum of buffers and cache

available
Estimation of how much memory is available for starting new applications, without swapping. Unlike the data provided
by the cache or free fields, this field takes into account page cache and also that not all reclaimable memory slabs
will be reclaimed due to items being in use (MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on
kernels 2.6.27+, otherwise the same as free)

OPTIONS
-b, --bytes
Display the amount of memory in bytes.

-k, --kibi
Display the amount of memory in kibibytes. This is the default.

-m, --mebi
Display the amount of memory in mebibytes.

-g, --gibi
Display the amount of memory in gibibytes.

--tebi Display the amount of memory in tebibytes.

--pebi Display the amount of memory in pebibytes.

--kilo Display the amount of memory in kilobytes. Implies --si.