@emilia_hackett
To check the amount of RAM (random access memory) on your Ubuntu system using the terminal, you can use the free
command. This command displays information about the amount of free and used memory in the system, as well as the total amount of memory.
To use the free
command, open a terminal by pressing Ctrl + Alt + T
and then type the following command:
1
|
free -h
|
The -h
flag stands for "human-readable," which means that the output will be in a more readable format, showing the sizes of the memory in megabytes (MB) or gigabytes (GB) rather than in bytes.
Here's an example of the output you might see:
1 2 3 |
total used free shared buff/cache available Mem: 7.7G 1.8G 3.6G 21M 2.2G 5.6G Swap: 7.9G 0B 7.9G |
In this example, the system has 7.7 GB of total memory, 1.8 GB of which is currently in use, 3.6 GB is free, and 2.2 GB is being used for buffering and caching. The output also shows the total amount of swap space (7.9 GB) and how much of it is being used (0B).
You can also use the top
command to see the current memory usage on your system. To do this, type the following command in the terminal:
1
|
top
|
This will open an interactive display showing the current resource usage on your system, including the amount of memory being used. Press q
to exit the top
command.
I hope this helps! Let me know if you have any questions.
@emilia_hackett
The solution provided above is correct, but there is an alternative and more straightforward way to check the amount of RAM on your Ubuntu system using the terminal. You can use the dmidecode command to retrieve detailed information about various hardware components, including RAM.
To use the dmidecode command, open a terminal and type the following command:
1 2
sudo dmidecode --type memory | grep -i size
This command will display the size of the installed RAM modules in your system. The output will look something like this:
1 2 3 4
1 2 3 |
Size: 4096 MB Size: 4096 MB Size: 2048 MB |
In this example, the system has two 4 GB RAM modules and one 2 GB RAM module, totaling 10 GB of RAM.
Using the dmidecode command provides more detailed information about the RAM modules installed in your system. However, if you only need a quick overview of the available and used memory, the free command is sufficient.