"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 Linux systems.

Another important information about your Linux system is the memory. You can use the "free" command to display memory statistics including free and used memory sizes. Here are some examples of "free" command output on my CentOS computer.

1. Display memory information using "free" with default options. The memory counts are displayed in kibibytes (1,024 bytes). Note that a kibibyte (1,024 bytes) is slightly different than a kilobyte (1,000 bytes).

herong$ free
           total     used     free   shared  buff/cache   available
Mem:     7789220  2047412   677256   297448     5064552     5145248
Swap:    8085500        0  8085500

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:        7606     1999      661      290        4945        5024
Swap:       7895        0     7895

3. Or you can use "free -h" to display counts in human readable formats.

herong$ free -h
           total     used     free   shared  buff/cache   available
Mem:       7.4Gi    2.0Gi    661Mi    290Mi       4.8Gi       4.9Gi
Swap:      7.7Gi       0B    7.7Gi

The output columns are defined as:

Table of Contents

 About This Book

Introduction to Linux Systems

 "uname" - Display System Information

"free" - Display Free and Used Memory

 Process Management

 Files and Directories

 Running Apache HTTP Server (httpd) on Linux Systems

 Running Apache Tomcat on Linux Systems

 Running PHP Scripts on Linux Systems

 Running MySQL Database Server on Linux Systems

 Running Python Scripts on Linux Systems

 Conda - Environment and Package Manager

 GCC - C/C++ Compiler

 OpenJDK - Open-Source JDK

 Graphics Environments on Linux

 SquirrelMail - Webmail in PHP

 Tools and Utilities

 References

 Full Version in PDF/EPUB