Close Menu
    Facebook X (Twitter) Instagram
    Command Linux
    • About
    • How to
      • Q&A
    • OS
      • Windows
      • Arch Linux
    • AI
    • Gaming
      • Easter Eggs
    • Statistics
    • Blog
      • Featured
    • MORE
      • IP Address
      • Man Pages
    • Write For Us
    • Contact
    Command Linux
    Home - How to - How to Check RAM in Linux

    How to Check RAM in Linux

    WillieBy WillieJanuary 28, 2026Updated:March 27, 2026No Comments4 Mins Read

    RAM plays a vital role in every Linux machine. Monitoring memory usage helps prevent system slowdowns. When memory runs low, your server may become unresponsive or crash under heavy workloads. Learning how to check RAM in Linux allows you to take preventive measures early before problems escalate. This guide covers multiple methods to verify memory consumption on your Linux system efficiently and accurately. You’ll discover command-line tools that reveal real-time statistics and hardware specifications with minimal effort. Each method serves different purposes, from quick checks to detailed analysis of system resources and performance metrics.

    free

    The simplest way to check RAM in Linux is through the free command. Open your terminal and type:

    $ free

    This displays memory statistics in kilobytes. The output shows two sections: physical memory and swap space. The total column shows complete memory installed on your machine. Used represents currently consumed memory. Free indicates unused memory available.

    For easier reading, add the -h flag:

    $ free -h

    This presents values in gigabytes and megabytes. You can combine flags, such as -th, to display totals in a human-readable format.

    top

    The top utility provides real-time monitoring. It comes pre-installed on most distributions. Run it by typing:

    $ top

    Watch the %MEM column to identify memory-hungry processes. Press Shift + M to sort by memory consumption. At the top of the output, you’ll see system statistics showing total RAM available and how much is currently in use.

    You can comb through the list and see what percentage of memory each process uses. This tool helps you quickly identify applications that consume excessive resources. Press q to exit when finished.

    htop

    Htop offers an improved interface compared to the basic top command. Install it first:

    $ sudo apt install htop

    Then launch it:

    $ htop

    This displays colorful bars showing memory and CPU usage. You can scroll through processes vertically and horizontally. Each running program appears with its complete command line. Htop updates statistics continuously, making it perfect for live monitoring.

    vmstat

    The vmstat utility provides another method to check RAM in Linux. This particular command reports virtual memory statistics including processes, memory, paging, block IO, and CPU activity:

    $ vmstat -s

    This outputs memory statistics in a vertical list format. You’ll see active memory, inactive memory, buffer usage, and swap details. The command gives you more information than you need, but comprehensive data helps troubleshooting.

    dmidecode

    Sometimes you need physical memory details rather than usage statistics. The dmidecode command reveals hardware information:

    $ sudo dmidecode --type memory

    This shows your RAM capacity, slot locations, and memory type. You’ll see which DIMM slots contain modules. Understanding your hardware helps when planning upgrades. The output can be lengthy, so you might want to pipe it to the less command for easier navigation.

    /proc/meminfo

    The kernel stores memory data in a special file. You can view it using:

    $ cat /proc/meminfo

    This file contains comprehensive details about your system’s memory state. It shows total memory, available space, buffer usage, and swap information. Both free and vmstat commands pull their data from this file.

    This is not a real file. Instead /proc/meminfo is a virtual file that contains real-time, dynamic information about the system. You’ll want to check values for MemTotal, MemFree, MemAvailable, Buffers, Cached, and SwapTotal. If you want cleaner output, use it with egrep to filter specific entries.

    FAQs

    Which command shows RAM usage in real time?

    The top and htop commands display real-time memory usage. Both update continuously while running. Htop provides a more visual interface with colorful bars and easier navigation. Top is available on all systems by default without installation.

    How do I check total RAM installed on Linux?

    Use the free -h command to see total installed RAM in human-readable format. Alternatively, run sudo dmidecode –type memory for detailed hardware information including capacity, speed, and slot locations. You can also check /proc/meminfo for comprehensive memory statistics.

    What does the available column mean in free output?

    The available column estimates memory ready for new applications without swapping. Unlike the free field, this considers page cache and reclaimable memory. Available memory provides a more accurate picture of usable RAM than the free column alone.

    Can I check RAM without installing new tools?

    Yes, use built-in commands like free, top, vmstat, or cat /proc/meminfo. These come pre-installed on virtually all Linux distributions. They require no additional packages or installation. You can monitor memory usage immediately after system installation without any setup.

    How do I find which process uses most memory?

    Run top -o %MEM to sort processes by memory usage. The process consuming the most RAM appears at the top. You can also use ps aux with sort commands or check htop’s memory column. This helps identify memory-hungry applications quickly.

    Willie
    • Website

    Willie has over 15 years of experience in Linux system administration and DevOps. After managing infrastructure for startups and enterprises alike, he founded Command Linux to share the practical knowledge he wished he had when starting out. He oversees content strategy and contributes guides on server management, automation, and security.

    Related Posts

    How to Prepare a Linux Mint Live USB

    April 17, 2026

    How To Take Screenshot on Linux

    April 15, 2026

    How to Use the Linux Restart Command to Reboot Your Server

    April 15, 2026

    How To Run A Shell Script In Linux

    April 13, 2026
    Top Posts

    PPSH

    February 25, 2026

    PROCMAIL

    February 19, 2026

    fiberlamp

    February 4, 2026

    Fuse Patterson Login

    March 11, 2026
    • Home
    • Contact Us
    • Privacy Policy
    • Terms of Use

    Type above and press Enter to search. Press Esc to cancel.