Check Linux Memory Usage Using “Free” Command

linux

Free command displays information about the physical (RAM) and swap memory of your system.

In the example below, the total physical memory displayed below are in KB.


root@cloud1:~# free
             total       used       free     shared    buffers     cached
Mem:        262144     193900      68244          0          0      42964
-/+ buffers/cache:     150936     111208
Swap:       524288     186196     338092

The following example will display the total memory on your system including RAM and Swap.

In the following command:

option m displays the values in MB
option t displays the “Total” line, which is sum of physical and swap memory values
option o is to hide the buffers/cache line from the above example.

root@cloud1:~# free -mto
             total       used       free     shared    buffers     cached
Mem:           256        189         66          0          0         41
Swap:          512        181        330
Total:         768        371        396
root@cloud1:~#
root@server10 [/home]# free -m
             total       used       free     shared    buffers     cached
Mem:          7946       7772        173          0        235       2492
-/+ buffers/cache:       5044       2901
Swap:         2047        786       1261
root@server10 [/home]# 

About Annie

I've been working in Technical Section for over 10 years in a wide range of tech jobs from Tech Support to Software Testing. I started writing blog for my future reference and useful for all.