How to check memory usage command line on linux

Linux is having different set of utility command line tools, one of them is free. We use it determine used physical memory, swapped memory and available memory. That is, you can get RAM statistics using this command.

Display memory (RAM) information

To display physical memory information just type free

But it is less readable. You can request command free to display memory in mega bytes or kilo bytes.

free takes several arguments. We can use them to format and display output as we need.

Typical usage of command free


To check memory statistics periodically at regular intervals use,

Here command,

free -k -s 1

displays memory in kilo bytes for every 1 second. To monitory memory usage in real time you better use top or any other monitoring tools available on linux rather than this command.

If you want to check memory consumed by specific process, you can use the command pmap

Command pmap

Command pmapsynopsis


Leave a Reply

Your email address will not be published. Required fields are marked *