Final answer:
To check RAM size in the Linux terminal, use commands like 'free -h' for an overview, 'sudo dmidecode --type memory' for detailed info, and 'cat /proc/meminfo' for complete memory usage details.
Step-by-step explanation:
To check the RAM size on a Linux system via the terminal, you can use several commands. One of the most commonly used commands is free, which displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel.
To check the RAM size, open the terminal and type the following command:
free -h
The -h option is used to provide the information in a human-readable format, displaying the size in megabytes (MB) or gigabytes (GB). Another useful command is dmidecode, specifically designed for dumping a computer's DMI (some say SMBIOS) table contents in a human-readable format. Use this command as follows:
sudo dmidecode --type memory
This will provide detailed information about each memory slot, including the installed RAM's size. You will need administrative privileges to use this command. The top or htop command can also be used to view the current memory usage in real-time. For static information, you can use the cat command to display the contents of /proc/meminfo, which includes detailed information about the system's memory usage.
cat /proc/meminfo
Using these commands, you can easily determine the RAM size and other memory-related information on your Linux system directly from the terminal.