Ubuntu Tutorials - Herong's Tutorial Examples - v1.25, by Herong Yang
"free" - Display Free and Used Memory
This section provides a tutorial example on how to display free and used memory information using the 'free' command on Ubuntu systems.
Another important information about your Ubuntu system is the memory. You can use the "free" command to display memory statistics including free memory and used memory sizes. Here are some examples of "free" command output on my Ubuntu computer.
1. Display memory information using "free" with default options. The memory counts are displayed in units of kibibytes (KiB) (1,024 bytes). Note that a kibibyte (1,024 bytes) is slightly different than a kilobyte (KB) (1,000 bytes).
herong$ free
total used free shared buff/cache available
Mem: 3709516 1218952 652908 176128 1837656 2028376
Swap: 999420 828844 170576
The above output shows that:
2. To control the unit, you can use "free -b | k | m | g" options.
herong$ free -m
total used free shared buff/cache available
Mem: 3622 1178 686 170 1757 1993
Swap: 975 807 168
3. Or you can use "free -h" to display counts in human readable formats. And add "-w" to separate "buff" and "cache".
herong$ free -h -w
total used free shared buffers cache available
Mem: 3.5G 1.2G 684M 171M 141M 1.6G 1.9G
Swap: 975M 807M 168M
The output columns are defined as:
Table of Contents
►Introduction to Ubuntu Systems
hostnamectl - Display System Information
►"free" - Display Free and Used Memory
"who | w" - Logged-in Users and Their Running Commands
GNOME - Desktop Interface and Environment
Shell - The Command-Line Interpreter