How to Find Out How Much RAM You Have in Ubuntu Using free

Whether you are setting up a new virtual private server (VPS), troubleshooting a sluggish desktop, or verifying that a recent hardware upgrade was recognized, checking your system’s memory is a fundamental administrative task. In Ubuntu Linux, you don’t need a heavy graphical user interface to monitor your resources.

The most efficient and standard way to check your Random Access Memory (RAM) from the terminal is by using the built-in free command. This lightweight utility instantly prints a snapshot of your physical memory and swap space utilization.

This guide explains how to use the free command effectively to find out exactly how much RAM you have and how it is currently being used.

Step 1: Open the Terminal

If you are using Ubuntu Desktop with a graphical interface, you can open the terminal by pressing Ctrl + Alt + T on your keyboard. If you are connected to an Ubuntu Server, you are already at the command line.

Step 2: Run the Basic free Command

To get a quick overview of your system memory, simply type the command by itself:

  1. Type the following and press Enter:
    free

The terminal will output a small table containing rows for “Mem” (Physical RAM) and “Swap” (Virtual memory on your hard drive). However, you will notice that the numbers look incredibly large and difficult to read. By default, the free command displays all values in kilobytes (KB).

Step 3: Make the Output Human-Readable

To make the output easier to understand, you should append the -h (human-readable) flag. This forces the command to automatically scale the numbers into Megabytes (MB) or Gigabytes (GB) depending on the size.

  1. Type the following command and press Enter:
    free -h

Look at the Mem: row. Here is what the columns mean:

  • total: The absolute total amount of physical RAM installed in your system (e.g., 15Gi for 16GB, accounting for hardware reservations).
  • used: The amount of RAM currently being consumed by active processes.
  • free: The amount of RAM completely untouched.
  • shared: Memory used mostly by temporary file systems (tmpfs).
  • buff/cache: RAM being used by the Linux kernel to cache files for faster future access. This memory will be instantly freed up if an application needs it.
  • available: The actual, practical amount of RAM you have left to start new applications without the system needing to use the slower Swap space.

Tip: If you want to continuously monitor your RAM usage, you can combine free with the watch command to update the output every two seconds: watch free -h. Press Ctrl + C to exit.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.