How To Check Ram Details In Ubuntu Through Terminal ?

Aswin Satheesh
featurepreneur
Published in
3 min readSep 3, 2021
Photo by Gabriel Heinzer on Unsplash

As Ubuntu users, especially as administrators, we need to check how much RAM resources our system uses and how much of it is free. We also know that most administration-related tasks can be done better through the Linux command line than through the graphical user interface.

What is RAM ?

Random-access memory (RAM) is a form of computer data storage which stores frequently used program instructions to increase the general speed of a system. A random-access memory device allows data items to be read or written in almost the same amount of time irrespective of the physical location of data inside the memory.

we are using the Ubuntu command line, the Terminal application. You can open the terminal either by using the system dash or the key combination Ctrl+alt+T .

  1. check the type of RAM you have installed on your Ubuntu machine using the following command:
$ sudo dmidecode --type memory | less

2 . Run following command to see RAM information in KB (1 KB is equal to 1024 bytes).

$ free

3 . Run following command to see RAM information in MB (1 MB is equal to 1024 KB).

$ free -m

4 . Run following command to see RAM information in GB (1 GB is equal to 1024 MB).

$ free -g

5 . In order to view memory statistics through the vmstat command, you can use it in the following manner:

$ vmstat -s

6 . The following command extracts memory-related information from the /proc file system. These files contain dynamic information about the system and the kernel rather than the real system files.

$ cat /proc/meminfo

7 . The top command is used to print CPU and memory usage of your system.

$ top

8. htop command gives a detailed analysis of your CPU and memory usage.

$ sudo apt-get update

installing htop by entering the following command as sudo:

$ sudo apt install htop

Once htop is installed, you can simply use the following command to print the detailed analysis of your CPU and memory usage:

$ htop

These are the some methods to check the Ram details in Ubuntu through terminal.

Thanks for reading. Hope it was useful.

Happy learning.

--

--