How To Find Memory In Linux

Whether you’re a Linux beginner or a seasoned user, it’s important to understand your system’s memory usage. It helps optimize your system’s performance and prevent it from crashing due to excessive memory usage. In this blog post, we will guide you on how to find memory in Linux.

Using the free Command

One of the most common ways to check memory usage in Linux is by using the free command. This command provides information about total used and free space of physical memory and swap memory in the system. To use the free command, open your terminal and type the following command:

    free -h
    

The ‘-h’ option stands for “human-readable,” and it makes the output easier to understand by converting the numbers into a more understandable format (like KB, MB, and GB).

Using the /proc/meminfo file

The /proc/meminfo file contains real-time information about the system’s memory usage. You can read this file using the cat command:

    cat /proc/meminfo
    

This command will display a lot of information, including total memory, free memory, and available memory.

Using the top Command

The top command provides a dynamic, real-time view of the running system. It displays system summary information and a list of processes currently being managed by the kernel. The top command shows how much processing power and memory are being used, as well as other information about the running processes. Use the following command to execute it:

    top
    

In conclusion, understanding and keeping track of your Linux system’s memory usage is crucial for maintaining its overall performance. Whether you prefer using the free, cat, or top command, the choice ultimately depends on what information you need and how you like it displayed.