How to display memory information in Linux?
 

How to display memory information in Linux?

 

The system memory or RAM is an essential part of a computer system. It is used to store the working data and machine code. It is much faster and expensive than the other storage media such as hard disk, CD disk, magnetic tapes, etc.

So knowing about your system’s memory which includes information such as total, free, and used memory, etc can be very helpful in administering the resources of a system.

In this article, we will discuss the different ways to check memory information on a Linux system.

Get memory info using /proc/meminfo

The /proc/meminfo is a file that stores all the information of memory. Many other commands fetch the memory information from this file. We can display the content of this file using one of the following commands in your terminal –

cat /proc/meminfo

or use –

more /proc/meminfo

or you can also use –

less /proc/meminfo

Now you can see the output of this command in the image below –

Find memory info using free command

Free is a command that can be used to display the free and used memory on a Linux system. It shows the statistics of both physical and swap memory.

Now to display the memory info in your terminal use –

free

Or use the following command to see the size of memory in megabytes –

free -m

As you can see in the image above it displays the total, used, free, shared, buff/cache, and available memory.

How to check system memory usage using top command

The top command is one of the most frequently used commands on a Linux or Unix system for administrative tasks. By using this command you can view dynamic and real-time views of processes running in a system.

We can use this command to monitor the memory usage on a system. Now run the following command in your terminal –

top

See the output of this command –

The highlighted part in this image shows the memory information and its usage the size of memory is given in megabytes.

Display virtual memory statistics using vmstat command

The vmstat command in Linux shows the information about processes, memory, paging, block IO, etc. To display the memory usage using vmstat command you need to use option -s with it.

Now execute the following command in your terminal –

vmstat -s

Conclusion

This is how you can check the memory information on a Linux system. Now if you have a query then leave it in the comments below.

Previous [ubuntu] GRUB terminal appears after fixing GRUB menu
Next XONAR AE Sound card
 

About author

You might also like

Linux Terminal 0 Comments

How to create a file in the Linux terminal?

A file on a computer stores data, information, settings, etc. On a Linux system, you can create a file in so many ways for instance if you are using GUI

Linux Terminal 0 Comments

How To Use less Command To Read The Content Of A Text File In Linux, Unix or FreeBSD?

This post was last updated on August 1st, 2020 at 05:16 pmThere are many ways to read a text file in Linux or Unix operating system. You can use a

Linux Terminal 0 Comments

How To Install Korn Shell in Ubuntu?

This post was last updated on August 1st, 2020 at 03:44 pmA Unix shell is a program that interprets the command or script and acts as an intermediary between user

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply