How to check ram size in Linux


To check the RAM (memory) size in Linux, you can use various commands and methods. Here are a few common approaches:

Using the free command:

Open a terminal and run the following command:

free -h 

This command will display memory-related information, including the total RAM, used RAM, free RAM, and other details. The size will be displayed in human-readable format (e.g., GB, MB).

Using the cat command on the /proc/meminfo file:

Open a terminal and run the following command:

cat /proc/meminfo 

This command will display detailed information about the system’s memory, including the total RAM size, available RAM, and other memory-related details. Look for the “MemTotal” field to find the total RAM size.

Using the dmidecode command:

The dmidecode command provides information about the system’s hardware, including RAM details. Open a terminal and run the following command:

sudo dmidecode --type 17 

This command will display detailed information about the RAM modules installed in the system, including the size, speed, and other specifications.

These methods should help you determine the RAM size on your Linux system. Choose the appropriate method based on the level of detail you need and the available tools on your system.