Posted: . At: 5:29 PM. This was 10 years ago. Post ID: 7688
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


How to see free memory on a Linux machine with the free command.


The free command in Linux is used to show the amount of free memory in Linux. The example below shows the default usage of this command.

ubuntu@ip-172-31-0-140:~$ free 
             total       used       free     shared    buffers     cached
Mem:        602736     294680     308056      16928      17632     146320
-/+ buffers/cache:     130728     472008
Swap:            0          0          0

The free -m command will show the free memory in megabytes.

ubuntu@ip-172-31-0-140:~$ free -m
             total       used       free     shared    buffers     cached
Mem:           588        290        298         16         17        144
-/+ buffers/cache:        127        460
Swap:            0          0          0

This version: free -k shows the output in kilobytes.

ubuntu@ip-172-31-0-140:~$ free -k
             total       used       free     shared    buffers     cached
Mem:        602736     297244     305492      16928      18248     147996
-/+ buffers/cache:     131000     471736
Swap:            0          0          0

The -t parameter will show an extra line that shows the totals for each column.

ubuntu@ip-172-31-0-140:~$ free -t
             total       used       free     shared    buffers     cached
Mem:        602736     298696     304040      16928      18384     148168
-/+ buffers/cache:     132144     470592
Swap:            0          0          0
Total:      602736     298696     304040

Combined with the -m parameter, you will get a good picture of your memory usage.

ubuntu@ip-172-31-0-140:~$ free -t -m
             total       used       free     shared    buffers     cached
Mem:           588        291        297         16         17        144
-/+ buffers/cache:        128        459
Swap:            0          0          0
Total:         588        291        297

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.