Commands to show Memory info

How much RAM do your computer has? and better, how can you get detailed information about your RAM? If you wanna upgrade your computer’s memory this information will be useful. I  found a command that gave me all the necessary information and much more. The information we will see when typing this command will be very detailed, from the amount of memory slots that the PC has available, speed, latency, type and many more things.

To type the command in question we have to open the Ubuntu Terminal and put the following:


sudo dmidecode --type memory


Yes, you need sudo. Enter your password and we will see something similar to the following:

As you can see in the image we have a lot of data about the RAM that we have in our computer. With the data you are able to see on the screen you can buy the right memory to upgrade your computer/laptop or server.
The most advisable thing if we are going to extend the RAM of a computer is to have a couple of slots occupied and that they are equal, that way we can take advantage of the Dual Channel technology and our computer will go faster.
Another command that can be useful to see the amount of RAM installed in our computer and see how busy and free is “free”, if we run in the Ubuntu Terminal will see the following on the screen:


free command
free -h


This is the description of every category:

total Total installed memory (MemTotal and SwapTotal in /proc/meminfo)

used Used memory (calculated as total – free – buffers – cache)

free Unused memory (MemFree and SwapFree in /proc/meminfo)

shared Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, available
on kernels 2.6.32, displayed as zero if not available)

Sum of buffers and cache

Estimation of how much memory is available for starting new applications, without swapping. Unlike the data provided by the cache or free fields, this field takes into account page cache and also that not all reclaimable memory slabs will be reclaimed due to items being in use (MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as free)

As you can see this command shows us the RAM we currently have in the computer how much is occupied and how much is free and also shows us information about the state of the Swap.

top command

The top command provides a dynamic real-time view of a running system including a quick summary information about RAM, CPU also as a list of tasks currently being managed by the Linux kernel. Type the following command:

 vmstat command
The vmstat command can display memory statistics including additional information about processes, paging, block IO, traps, and cpu activity. Type the following command:
vmstat -s


Have any of these commands been helpful to you?